Python Pattern Program - Number Pattern (Printing Numbers in Pyramid Shape)

Поділитися
Вставка
  • Опубліковано 13 жов 2024
  • In this Python Pattern Programming video tutorial you will learn How to print numbers in pyramid shape in detail.
    To print numbers in pyramid shape we will use nested for loops.
    For more free tutorials on computer programming
    / amulsacademy
    / amulsacademy

КОМЕНТАРІ • 261

  • @МаксимБездітко
    @МаксимБездітко 3 роки тому +13

    Personally I am from Ukraine and i have been looking for such a cool and skillful teacher like you for so long time. And finally i succeed. You can explain such uneasy and sometimes challenging things in a really good and easy to understand way so that I am just being amazed at your skills of teaching. With love from Ukr! The English Language is a great force. I am only 15 years old and I reckon everything is ahead!

  • @gauravkumar2602
    @gauravkumar2602 3 роки тому +3

    Best teacher !!! Thanks a lot Mam.
    I tried solving this by myself , without watching your video. Hope it will help someone.
    rows =8
    for i in range(1,rows):
    for j in range(rows-i,-1,-1):
    print(end=" ")
    for j in range(i,0,-1):
    print(j, end="")
    for j in range(2,i+1,):
    print(j, end="")
    print()

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому +1

      ❤️😊

    • @gauravkumar2602
      @gauravkumar2602 3 роки тому

      @@AmulsAcademy Just a request , in your upcoming videos please explain time complexity as well, while explaining algorithms.

  • @laxmikanthghali5388
    @laxmikanthghali5388 4 роки тому +9

    This is outstanding channel, to build the logic from scratch!! Amulyaji aap ka voice, teaching style awesome, it wont distract when u are teaching. Love it it!!

  • @ladiyuktha6154
    @ladiyuktha6154 5 років тому +7

    U r voice is too good to listen
    And u r explaining perfectly

    • @ladiyuktha6154
      @ladiyuktha6154 5 років тому

      I want some more patterns like this☺️☺️

  • @hemantheswar8118
    @hemantheswar8118 4 роки тому

    you really made a hard work to make users understand in a simple way but i had to concentrate a lot to understand as your voice distracted me a lot..........your voice is god gift......

  • @sayanrc5131
    @sayanrc5131 5 років тому +8

    Can u please upload some harder patterns? It would be a great help.
    And thanks for this one...it really helped a lot

    • @AmulsAcademy
      @AmulsAcademy  5 років тому +2

      Ok :)

    • @shesharajupallysaikumar904
      @shesharajupallysaikumar904 4 роки тому

      ​@@AmulsAcademy your program was wrong (check with 10 or above value , you wont get pyramid) you can observe at 11:14 last line of output pattern was wrong

    • @nandalala7915
      @nandalala7915 4 роки тому

      @@shesharajupallysaikumar904 that is double digit 10

  • @vikaskait5057
    @vikaskait5057 5 років тому +7

    Mam your teaching is awesome.. I really love your teaching.. Mam I want python program for "pascal's triangle" will you please mam..

  • @shivanshsrivastava1715
    @shivanshsrivastava1715 4 роки тому +1

    Ur explanation is crystal clear 👍

  • @muralikonkoth4161
    @muralikonkoth4161 3 роки тому +4

    Great.Well explained for beginners.Thanks a lot for sharing knowledge.

  • @trendingvedio7564
    @trendingvedio7564 3 роки тому +2

    Your voice is lovely ❤️ and so easily you teach them all in a simple way with easy and understanding English language for new comers 🙏plz you always make this type of coding vedios we learn to you a different and good kind of logics , methods, 🙏jai shree ram 🙏, keep going on

  • @apexbioaccounts6375
    @apexbioaccounts6375 4 роки тому +9

    Thank You for supporting us madam,,,

  • @creativesangeeth8343
    @creativesangeeth8343 4 роки тому +1

    Absolutely ur good teacher in python

  • @Miguel-qw6bn
    @Miguel-qw6bn 3 роки тому +1

    Thank You for supporting !

  • @harin1846
    @harin1846 5 років тому +3

    Can you explain how one can code to print Binomial Distribution or Pascal's Triangle, like 1, 11, 121, 1331, etc? Thank you.

  • @jagadheeshsiripurapu1555
    @jagadheeshsiripurapu1555 3 роки тому +1

    In love with ur voice amulya.. plzz like me

  • @babjiky
    @babjiky 4 роки тому +3

    Hi, I started learning python... Too good lesson... Really thanks to U..

  • @frankhuman9972
    @frankhuman9972 4 роки тому +4

    Simply you’re a genius

  • @tejasvimangal2184
    @tejasvimangal2184 2 роки тому +2

    Are 4 loops required?
    n = int(input("Enter the number: "))
    L = [x for x in range(1, n+1)]
    for i in range(1, n+1):
    a = list(map(str, L[0:i]))
    s = " ".join(a[1:][::-1] + a)
    print(s.center((4*n)-3, " "))

  • @madinasushma1074
    @madinasushma1074 4 роки тому +1

    Tank you so much madam. Your video help to learn Python easily

  • @AR-ut1qe
    @AR-ut1qe 4 роки тому +2

    Great video! How could I do the inverse? I mean, add or score 1 in the middle instead of substracting. I am trying but I can't.

  • @alaranaprathap1891
    @alaranaprathap1891 5 років тому +2

    Really very good and awesome explanation

  • @doyouknow243
    @doyouknow243 3 роки тому +2

    You explain very well mam 😊

  • @jafarbasha4394
    @jafarbasha4394 4 роки тому

    Nice.. Easy to understand... Thankyou amuls

  • @fahadmustafa650
    @fahadmustafa650 5 років тому +7

    Thanks Mam
    Respect from Pakistan

  • @praveenboddu3629
    @praveenboddu3629 5 років тому +4

    Explanation is simply superb Ms.Amulya :-)

  • @prathamsingh5467
    @prathamsingh5467 4 роки тому +1

    Great job👨‍💻👨‍💻👨‍💻

  • @amit342kumar
    @amit342kumar 4 роки тому

    Very very good voice for aur learning Python ..am realy attract.

  • @mddelowarhossain1075
    @mddelowarhossain1075 5 років тому +3

    Awesome! Please, keep posting with new programming solutions. Thank you...:)

    • @AmulsAcademy
      @AmulsAcademy  5 років тому +2

      Thank you :)
      Yes i will keep posting videos on new topics.
      Keep learning
      :)

  • @nihalsingh9987
    @nihalsingh9987 3 роки тому +1

    Very nice
    Madam👍👍👍👍

  • @dharshinimagesh9591
    @dharshinimagesh9591 4 роки тому +3

    hi mam . i understand when u teach but feel difficult to do myself . how to improve my programming knowledge .

  • @jaigarage9868
    @jaigarage9868 5 років тому +1

    Good programmer. Pls explain how to copy data from online with python xml....

  • @amng518
    @amng518 5 років тому +4

    Mam output is coming in different shape

  • @nanichinna8976
    @nanichinna8976 4 роки тому +1

    Your voice is inspiring a lot

  • @bvspa
    @bvspa 3 роки тому +1

    Thank you Ma'am

  • @SurajPrajapati-bl5vp
    @SurajPrajapati-bl5vp 5 років тому +1

    Nice explanation mam...

  • @niveditachowdhury9499
    @niveditachowdhury9499 6 років тому +4

    instead of writing end=" "we can just put a comma also. Thanks a lot by the way

  • @शिवणकला
    @शिवणकला 5 років тому +2

    Great and thanks

  • @thokalarajesh9989
    @thokalarajesh9989 4 роки тому

    Excellent madam it is very much interested madam tq sooooooooo much

  • @abhijitdutta9846
    @abhijitdutta9846 6 років тому +1

    Madam thank you for the pattern program. But I think in all the print statements inside the for loops we need space. Otherwise pattern does not come as exact as shown in the beginning. Thank you very much.

    • @AmulsAcademy
      @AmulsAcademy  6 років тому

      yes you can use space or you can use format() for space management
      :)

    • @abhijitdutta9846
      @abhijitdutta9846 6 років тому

      Amuls Academy

    • @abhijitdutta9846
      @abhijitdutta9846 6 років тому

      Thank you very much. How to generate Armstrong numbers. I know their are these numbers which are Armstrong but I am not able to generate it.. 153,370,371, and 407.

  • @sameulkumar7182
    @sameulkumar7182 6 років тому +1

    wow no words for your explanation!!!!!!

  • @dharanidharb6451
    @dharanidharb6451 5 років тому

    Mam which one do u use to compile

  • @akashtelkar853
    @akashtelkar853 5 років тому

    Which application Ur using to run python

  • @hariram-uu2qx
    @hariram-uu2qx 4 роки тому +1

    Very nice explanation thank you 😊

  • @ankitupadhyay8701
    @ankitupadhyay8701 2 роки тому

    nicely explained.good job.

  • @afees4981
    @afees4981 4 роки тому +1

    @amul acedamy Hi could u explain how range (I, 0,-1)
    Works

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому

      if i take range(5,0,-1) it will take value as 5 4 3 2 1
      :)

  • @ChelsiRomir
    @ChelsiRomir 3 роки тому +2

    What would be the program if v wanted to print the same triangle shape but instead of numbers v wanted "*"?

  • @flatscales2161
    @flatscales2161 4 роки тому +1

    awesome explaination

  • @babjiky
    @babjiky 4 роки тому +1

    Hi I have a doubt.. How to find Fibonacci number. Please can you send me code?

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому

      Video link:
      ua-cam.com/video/wN45AChk9U4/v-deo.html
      :)

    • @babjiky
      @babjiky 4 роки тому

      @@AmulsAcademy thanQ

  • @sudarsandm
    @sudarsandm 6 років тому +1

    Your videos are really good. Thanks for sharing with us.

  • @karimbudhwani3004
    @karimbudhwani3004 4 роки тому +1

    Thank you for this video. It helped me understand every iteration

    • @ajaypatidar2822
      @ajaypatidar2822 Рік тому

      ua-cam.com/play/PLFMdA1UJVR4bm0o8vTa9dcOS3_HNSP-fa.html

  • @Music.Air99
    @Music.Air99 3 роки тому +1

    thank you so much mam explained great!

  • @majurakanpuvanendran732
    @majurakanpuvanendran732 4 роки тому

    Easy to understand python .this video more help.pls upload php lesson video.

  • @Jc-handle-with-care
    @Jc-handle-with-care 4 роки тому +1

    thanks, ,you re a good teacher

  • @Navya-s8o
    @Navya-s8o 3 роки тому +2

    When I execute same program in my laptop I won't getting actual output some what am getting what's wrong?

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      Give me the program please, i will check :)

  • @The_WarMachine
    @The_WarMachine 3 роки тому +1

    Can we reduced the numbers of code line

  • @sandeepkunwr1178
    @sandeepkunwr1178 5 років тому +3

    Voiceeeeeee😍😍😍😍

  • @puneethas5843
    @puneethas5843 5 років тому +1

    Pls give me suggestions how print in C program....to print value range

  • @venkateshkarthick7935
    @venkateshkarthick7935 4 роки тому

    Learning is so good

  • @marciosilvaroballo2338
    @marciosilvaroballo2338 4 роки тому +1

    hello amuls very good code, congratulations on the channel

  • @krypton2780
    @krypton2780 3 роки тому +1

    Mam what's your python version, I can't run it correct

  • @gopalkrishnapanda7663
    @gopalkrishnapanda7663 6 років тому +2

    very well explained !! thanks a lot!!!

  • @adithyanvr1949
    @adithyanvr1949 Рік тому

    Thank you so much Mam

  • @sofianghazali8911
    @sofianghazali8911 6 років тому +1

    why did u add '0' in for loop(i,0,-1)? what is zero used for?

    • @AmulsAcademy
      @AmulsAcademy  6 років тому +3

      0 is the end value ,
      range() syntax is range(start, end, step).
      for i in range(5,0,-1) it will give output as 5 4 3 2 1 , here 0 is end value which is excluded in range().

    • @sofianghazali8911
      @sofianghazali8911 6 років тому +1

      thank you! makes sense!

    • @Ankit-mq6em
      @Ankit-mq6em 6 років тому

      Mam I am getting wrong patterns yyyy??

    • @mukunthanloganathan5802
      @mukunthanloganathan5802 5 років тому

      When we give range(5,0) it prints in reverse order then y should we give the step as -1. Crt me if i am wrong..plz

    • @tejas_gawali
      @tejas_gawali 5 років тому

      if you don't put 0 there it will not show 1 in that pattern

  • @flatscales2161
    @flatscales2161 4 роки тому +1

    Thank You Very Much For Such A Great Explanation : )

  • @nischaysingh
    @nischaysingh 5 років тому +1

    such a simple explanation. keep it up

  • @giorgibakuradze
    @giorgibakuradze 3 роки тому

    how can i build the list of pyramid with different numbers

  • @rupanisapthagiri8423
    @rupanisapthagiri8423 5 років тому +1

    what is the difference between a while loop and for loop

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      While loop will execute block of code until a certain condition is met.
      For loop is used to iterate over elements of a sequence. It will executes block of code "n" times.
      :)

    • @edagottisurekha5875
      @edagottisurekha5875 5 років тому

      While loop is used if iterations or unknown and for is used if the iterations are known

  • @mukunthanloganathan5802
    @mukunthanloganathan5802 5 років тому +1

    When we give range(5,0) it prints in reverse order then y should we give the step as -1. Help me with this problem..plz

    • @AmulsAcademy
      @AmulsAcademy  5 років тому +6

      by default step value is +1.
      when you mention range(0,5) by default it will take step value as 1 and we will get 0,1,2,3,4.
      But in range(5,0) starting value is 1 and ending is 0 and you didn't mentioned step so it will take default value that is +1, so it won't print anything.
      [You are telling to print values from 5 to 0 , and difference between second value and first value {step} to be +1 , it can't be possible.]
      so you should mention step as -1.
      range(5,0,-1): 5 4 3 2 1
      difference between second value{4} and first value{5} is -1.
      :)

  • @Abhijeetchandra3089
    @Abhijeetchandra3089 2 роки тому

    Why are you not uploading any video?

  • @SurajPrajapati-bl5vp
    @SurajPrajapati-bl5vp 5 років тому +1

    Nice voice
    .....

  • @anup161091
    @anup161091 5 років тому

    Please make a program video on pascal triangle

  • @joyprokash4013
    @joyprokash4013 Рік тому

    Thanks a lot

  • @manojkumarjampala4745
    @manojkumarjampala4745 2 роки тому

    Please make a program for palindrome number.... in python it is as asking frequently in many interviews

    • @ajaypatidar2822
      @ajaypatidar2822 Рік тому

      ua-cam.com/play/PLFMdA1UJVR4bm0o8vTa9dcOS3_HNSP-fa.html

  • @shesharajupallysaikumar904
    @shesharajupallysaikumar904 4 роки тому +1

    @Amuls Academy your program was wrong (check with 10 or above value , you wont get pyramid) you can observe at @11:14 last line of output pattern was wrong

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому

      Program is not wrong , Because 10 and above has 2 digits output looks like that.
      You can format the output using format() and you can get proper shape.
      :)

    • @shesharajupallysaikumar904
      @shesharajupallysaikumar904 4 роки тому

      @@AmulsAcademy thanks for reply plzz share the code using format() in comments

  • @mahadevleela3230
    @mahadevleela3230 3 роки тому +1

    Thanks a lottt

  • @voiceofyvr4006
    @voiceofyvr4006 4 роки тому +1

    can you tell that the code for * pattern

  • @ferakafs
    @ferakafs 2 роки тому

    Thanks a lot!!!🥰

  • @north4083
    @north4083 4 роки тому +1

    THANK U !!!!!!!!!!!!!!!!!!

  • @wildan2136
    @wildan2136 5 років тому +1

    dear mam. i have problem here i cant shape the triangle do somebody has the same issue?

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      Can you share your program here i will check :)

    • @wildan2136
      @wildan2136 5 років тому

      @@AmulsAcademy nvm i rechecked and its all fine thank u

    • @taran7954
      @taran7954 5 років тому

      Swaraj Shimpi you didn't declare the po function

  • @RanjithKumar-jo7xf
    @RanjithKumar-jo7xf 5 років тому +1

    Very useful one

  • @paramdeepsingh9496
    @paramdeepsingh9496 6 років тому +2

    hello mam... i find it difficult tht how do u make concepts in different pattern. i find it really tough.... plz help

    • @AmulsAcademy
      @AmulsAcademy  6 років тому +2

      You can write the program in different ways but you need to understand the logic first:)

  • @anontough6907
    @anontough6907 Рік тому

    I love your brain ;)

  • @sathishkumarm1501
    @sathishkumarm1501 6 років тому +2

    Mam, pls post Pascal triangle program

  • @arjunachu308
    @arjunachu308 3 роки тому +1

    can we do the came with alphabet

  • @saivsai3899
    @saivsai3899 2 роки тому

    Thanks mam and small bought

  • @sandeepKumar-sw3bx
    @sandeepKumar-sw3bx 2 роки тому

    Thank you mam for your brief explanation

  • @rajsingh966
    @rajsingh966 6 років тому +1

    i want to use it opposite of it .like an arrow but its not working just help

    • @janso8463
      @janso8463 6 років тому +2

      I tried this:
      num=9
      for i in range (1,num+1):
      for j in range (1,i):
      print (end=".")
      for j in range (num-i+1,1,-1):
      print (j, end="")
      for j in range(1,num-i+2):
      print (j, end="")
      print()

    • @vamsimanchikanti9399
      @vamsimanchikanti9399 5 років тому +1

      @@janso8463 num=9
      for i in range (1,num+1):
      for j in range (1,i):
      print (end=" ")
      for j in range (num-i+1,1,-1):

      print (j, end="")
      for j in range(1,num-i+2):
      print (j, end="")
      print()

  • @Trends_Forever
    @Trends_Forever 4 роки тому +1

    you just learn c-corner website you copy the c corner website code

  • @vijayasarathyr394
    @vijayasarathyr394 2 роки тому

    hi mam can you help me to print
    1
    2 3
    4 5 6
    and going on

  • @subhabratabasu9804
    @subhabratabasu9804 4 роки тому +2

    l=[1,2,3,4,5]
    for i in range(len(l)):
    print(l[i::-1]+(l[1:i+1]))
    more efficient logic

    • @DjR4D1C
      @DjR4D1C 4 роки тому +1

      yes maybe but for amateur fiorst starter this logic is more logic than your experienced one

    • @flatscales2161
      @flatscales2161 4 роки тому

  • @nageshj2050
    @nageshj2050 5 років тому +2

    Actually, we can print the Pyramid with just one for loop

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      Yes we can :)

    • @ArunRajpidige
      @ArunRajpidige 5 років тому +2

      @Anirvan Sen j=9 #variable used for denoting spaces
      n=int(input("enter how many rows of stars you want to print:"))
      for i in range(1,n,2):
      print(' '*j+i*'*')
      j=j-1

    • @ayeshamujeeb9661
      @ayeshamujeeb9661 5 років тому

      @@ArunRajpidige I have seen that video too.

  • @pratipaj
    @pratipaj 2 роки тому

    Please solve again full

  • @kajalnegi6282
    @kajalnegi6282 4 роки тому +1

    Best👍👍👍

  • @pavankumarsv419
    @pavankumarsv419 5 років тому +2

    Why you will not take 0th row

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      Because here i am printing value 1 in the first row, so i took range from 1.
      :)

  • @codopy
    @codopy 3 роки тому

    how can i reverse the pattern upside down

  • @abhiShek-zi4sh
    @abhiShek-zi4sh 4 роки тому

    this is better:
    c=int(input('please enter the number for this kind of structure'))
    for i in range(1,c+1,1):
    print(" "*(c-i) , end="")
    for j in range(1,2*i):
    if j

    • @nbhaskarreddy
      @nbhaskarreddy 4 роки тому

      Wrong out put

    • @nbhaskarreddy
      @nbhaskarreddy 4 роки тому

      try this: (you can optimize this code)
      num =int(input("Enter number of rows"))
      for i in range(num):
      for j in range((num+num)-1):
      if(j=num-(i+1) and j

  • @entertainclips6006
    @entertainclips6006 5 років тому +4

    if you take input as 100 then it is inefficient method as you see when you've given 10 it take some time.This is inefficient method

  • @nagav261
    @nagav261 5 років тому +2

    what is the code for 4th part

    • @AmulsAcademy
      @AmulsAcademy  5 років тому

      4th part is last space right?, No need to print that
      :)

    • @nagav261
      @nagav261 5 років тому

      @@AmulsAcademy ya I know that,but I tried to print * in that space.thats y I asked uand I got it

  • @SantoshSahu-so2ji
    @SantoshSahu-so2ji 6 років тому +1

    ur voice is so sweet

  • @jk3089
    @jk3089 4 роки тому +1

    Brilliant