Python Pattern Program - Number Pattern (Printing Numbers in Pyramid Shape)
HTML-код
- Опубликовано: 12 сен 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
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!
Thank you so much :)
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 Just a request , in your upcoming videos please explain time complexity as well, while explaining algorithms.
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!!
Thank you so much 😀
U r voice is too good to listen
And u r explaining perfectly
I want some more patterns like this☺️☺️
Mam your teaching is awesome.. I really love your teaching.. Mam I want python program for "pascal's triangle" will you please mam..
Can u please upload some harder patterns? It would be a great help.
And thanks for this one...it really helped a lot
Ok :)
@@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
@@shesharajupallysaikumar904 that is double digit 10
Great.Well explained for beginners.Thanks a lot for sharing knowledge.
Thank you :)
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......
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
Thank you 😊❤️
simp
Simply you’re a genius
Thank you :)
Ur explanation is crystal clear 👍
Thank you :)
Can you explain how one can code to print Binomial Distribution or Pascal's Triangle, like 1, 11, 121, 1331, etc? Thank you.
Thank You for supporting !
Pleasure 😊
Hi, I started learning python... Too good lesson... Really thanks to U..
Thank you :)
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, " "))
Absolutely ur good teacher in python
Thank you :)
You explain very well mam 😊
Thank you 😊
Explanation is simply superb Ms.Amulya :-)
Really very good and awesome explanation
Thank you :)
Awesome! Please, keep posting with new programming solutions. Thank you...:)
Thank you :)
Yes i will keep posting videos on new topics.
Keep learning
:)
Thank You for supporting us madam,,,
Mam output is coming in different shape
Tank you so much madam. Your video help to learn Python easily
Glad to hear that :)
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.
wow no words for your explanation!!!!!!
Thank you:)
Thank you for this video. It helped me understand every iteration
ruclips.net/p/PLFMdA1UJVR4bm0o8vTa9dcOS3_HNSP-fa
Your videos are really good. Thanks for sharing with us.
My pleasure:)
Your voice is inspiring a lot
Thank you :)
can you please make a program for letter "C"
very well explained !! thanks a lot!!!
Thank you:)
Great and thanks
Very very good voice for aur learning Python ..am realy attract.
Nice.. Easy to understand... Thankyou amuls
Good programmer. Pls explain how to copy data from online with python xml....
Great job👨💻👨💻👨💻
Thank you so much 😀
hello amuls very good code, congratulations on the channel
Thank you :)
thanks, ,you re a good teacher
Thank you! 😃
Thanks Mam
Respect from Pakistan
Thank you:)
Very nice explanation thank you 😊
Most welcome 😊
In love with ur voice amulya.. plzz like me
hi mam . i understand when u teach but feel difficult to do myself . how to improve my programming knowledge .
practicing
Thank You Very Much For Such A Great Explanation : )
You are welcome! :}
such a simple explanation. keep it up
Thank you :)
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.
yes you can use space or you can use format() for space management
:)
Amuls Academy
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.
thank you so much mam explained great!
Most welcome 😊
Voiceeeeeee😍😍😍😍
Excellent madam it is very much interested madam tq sooooooooo much
Nice explanation mam...
Thank you Ma'am
Pleasure :)
Easy to understand python .this video more help.pls upload php lesson video.
instead of writing end=" "we can just put a comma also. Thanks a lot by the way
In Python 2
In python2.
U r saying 3
Can we done this simply by comma??
Ri8
When I execute same program in my laptop I won't getting actual output some what am getting what's wrong?
Give me the program please, i will check :)
What would be the program if v wanted to print the same triangle shape but instead of numbers v wanted "*"?
in print function print star :)
Mam which one do u use to compile
Very nice
Madam👍👍👍👍
Thank you :)
Mam what's your python version, I can't run it correct
Python 3
@@AmulsAcademy thank you
nicely explained.good job.
Hi I have a doubt.. How to find Fibonacci number. Please can you send me code?
Video link:
ruclips.net/video/wN45AChk9U4/видео.html
:)
@@AmulsAcademy thanQ
Which application Ur using to run python
awesome explaination
Glad you liked it :)
Can we reduced the numbers of code line
Yes you can :)
you just learn c-corner website you copy the c corner website code
why did u add '0' in for loop(i,0,-1)? what is zero used for?
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().
thank you! makes sense!
Mam I am getting wrong patterns yyyy??
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
if you don't put 0 there it will not show 1 in that pattern
what is the difference between a while loop and for loop
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.
:)
While loop is used if iterations or unknown and for is used if the iterations are known
Thank you so much Mam
@amul acedamy Hi could u explain how range (I, 0,-1)
Works
if i take range(5,0,-1) it will take value as 5 4 3 2 1
:)
Thanks a lottt
Pleasure :)
Very useful one
Thank you :)
THANK U !!!!!!!!!!!!!!!!!!
Welcome :)
Why you will not take 0th row
Because here i am printing value 1 in the first row, so i took range from 1.
:)
Learning is so good
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
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.
:)
Why are you not uploading any video?
@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
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.
:)
@@AmulsAcademy thanks for reply plzz share the code using format() in comments
maam this is also not coming
this is the output coming
Enter the no of rows:4
1
212
32123
4321234
You are not printing space.
Check the for loop for which prints space.
:)
dear mam. i have problem here i cant shape the triangle do somebody has the same issue?
Can you share your program here i will check :)
@@AmulsAcademy nvm i rechecked and its all fine thank u
Swaraj Shimpi you didn't declare the po function
can we do the came with alphabet
Yes :)
Thanks a lot
Mam, pls post Pascal triangle program
ok:)
can you tell that the code for * pattern
Nice voice
.....
Thanks a lot!!!🥰
Please make a program video on pascal triangle
i want to use it opposite of it .like an arrow but its not working just help
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()
@@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()
how can i build the list of pyramid with different numbers
hi mam can you help me to print
1
2 3
4 5 6
and going on
I love your brain ;)
Please make a program for palindrome number.... in python it is as asking frequently in many interviews
ruclips.net/p/PLFMdA1UJVR4bm0o8vTa9dcOS3_HNSP-fa
hello mam... i find it difficult tht how do u make concepts in different pattern. i find it really tough.... plz help
You can write the program in different ways but you need to understand the logic first:)
Thanks!!!
Welcome:)
Best👍👍👍
Thank you :)
Pls give me suggestions how print in C program....to print value range
Thanks mam and small bought
how can i reverse the pattern upside down
what is the code for 4th part
4th part is last space right?, No need to print that
:)
@@AmulsAcademy ya I know that,but I tried to print * in that space.thats y I asked uand I got it
ur voice is so sweet
Thank you:)
Brilliant
Thank you :)
good work
Thank you:)
Please solve again full
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
Wrong out put
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
Actually, we can print the Pyramid with just one for loop
Yes we can :)
@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
@@ArunRajpidige I have seen that video too.