To print the odd number of stars (1,3,5,7,9...) with space between stars: for i in range(n): for j in range(n-i-1): print(" ", end=" ") for j in range(2*i+1): print("*", end=" ") print()
See, the code in the video is unnecesarily long n = int(input("No. of rows required: ")) for i in range(1,n+1): m = n-i print("-"*m, end="") print("x "*i) Try this
its incorect 1) The Space is not printed properly( It only prints 2 spaces per row 2) One layer less Fixed Code: n = int(input("No. of rows required: ")) for i in range(1,n+1): m = n-i print("-"*m, end="") print("x "*i) Sol 1)It should be m - i as for 5 rows the first row needs 4 spaces and thus, in the range 1,6(1,n+1) starting value of i will be 1 hence m-i(1) = 4 this fixes the space problem Sol 2) The range must be n+1 as the value of the range is start,end+1 hence if rows inputed is 5, for 5 rows a value of 1,6( n + 1)
# Generating Hollow Pyramid Pattern Using Stars row = int(input('Enter number of rows required: ')) for i in range(row): for j in range(row-i): print(' ', end='') # printing space required and staying in same line
for j in range(2*i+1): if j==0 or j==2*i or i==row-1: print('*',end='') else: print(' ', end='') print() # printing new line
this madea prarralelogram for me? x= int(input("please enter the amount of rows you would like: ")) for i in range(x): for j in range(x-i-1): print(" ",end="") for k in range(x+1): print("#",end=" ") print()
very well explained! saw so many videos but this was the easiest to understand :)
excellent explanation, not only for this questions but also help me to do other printing star pattern questions
Explained in a very simple way. Thanks👍
Most welcome 😊
n = 5
i = 1
while i
loved it ! thank u for teaching us !
This is really an excellent channel on Python like "techie talkee"
Thank you :)
Is it amulyas channel.Didnt know.Gonna subscribe
Thank you :)
Great explanation with a beautiful voice.Thanks
Thank you very much 👍 very easy and simple
You are welcome 😊
Ty bro, was about to give up ❤
Excellent explanation of logic the best channel for learning about patterns
Wah bete mauj kardi.
This is the short code that I have never seen in another videos and websites
Wow th way of explaining pyramid star very nice
Very helpful tutorial
thank you 😊
To print the odd number of stars (1,3,5,7,9...) with space between stars:
for i in range(n):
for j in range(n-i-1):
print(" ", end=" ")
for j in range(2*i+1):
print("*", end=" ")
print()
Is it possible to print an isosceles triangle?
Give me the pattern :)
this is an iscosceles already bro
Very Good explanation sister 😊
Which platform is she using here?
Thnks mam what a wonderful and simple explanation ❤
is it compulsory to take j can we use other alphabets
Yes you can :)
this was more good than our teacher
Hello newbie here maam. it show the full pyramid and the right.. what about the left? Thank u
See, the code in the video is unnecesarily long
n = int(input("No. of rows required: "))
for i in range(1,n+1):
m = n-i
print("-"*m, end="")
print("x "*i)
Try this
Thanks for everything mam😌😌👌
Most welcome :)
Thank you mam.. This is the best video i got ❤
Awesome Video and Good Explanation
You got one more subscriber 😊 Thanks very helpful
Simple explanation
What a nice explanation!!!
You are the best ❤
Amazingly Explained thanks
what an awesome explanation
Nice explanation
Hats off super mam
good explanation madam
Can we do it without input command?
It is possible but then yuuou can only get the pyramid for aa fixed value, ie cannot be inputed by the user
ты самая лучшая женщина на свете
your voice is very nice
Thanks ❤ dear
Welcome :)
thanks a lot
Excellent I understood please help in fubunocci
apka dhanyawaad
Thanks
i have an doubt
Loved your explanation..
bro thanks very good video
thankyou all doubt clear
Thank you!
i developed a very simple code for this
n=int(input("no of rows required: "))
m=n-2
for i in range(1,n):
print(' '*m,end='')
print('x '*i)
m=m-1
it prints 1 layer less
its incorect
1) The Space is not printed properly( It only prints 2 spaces per row
2) One layer less
Fixed Code:
n = int(input("No. of rows required: "))
for i in range(1,n+1):
m = n-i
print("-"*m, end="")
print("x "*i)
Sol 1)It should be m - i as for 5 rows the first row needs 4 spaces and thus, in the range 1,6(1,n+1) starting value of i will be 1
hence m-i(1) = 4
this fixes the space problem
Sol 2) The range must be n+1 as the value of the range is start,end+1 hence if rows inputed is 5, for 5 rows a value of 1,6( n + 1)
Atleast you tried and most importantly, it works. Just one row lesser.
Good explanation 😁
Thank you 😊
Thank you.
like your videos and voice tooo👍❣
Please explain hollow pymarid
# Generating Hollow Pyramid Pattern Using Stars
row = int(input('Enter number of rows required: '))
for i in range(row):
for j in range(row-i):
print(' ', end='') # printing space required and staying in same line
for j in range(2*i+1):
if j==0 or j==2*i or i==row-1:
print('*',end='')
else:
print(' ', end='')
print() # printing new line
U voice is like amulya academy only
This is Amulya academy second TH-cam channel only
why do indians say 'only' after every sentence
Great
Thank you :]
this madea prarralelogram for me?
x= int(input("please enter the amount of rows you would like: "))
for i in range(x):
for j in range(x-i-1):
print(" ",end="")
for k in range(x+1):
print("#",end=" ")
print()
Mera issi code se kuch or hi print kr rhaa h
Thnx mam
Ur amulya academi right
l=[]
for i in range(1,9,2):
l.append('*'*i)
for j in range(0,len(l)):
b=len(l[-1])-len(l[j])
c=int(b/2)
l[j]=" "*c+l[j]+" "*c
for p in l:
print(p)
Thanks madam 😊
U voice match with amulya academy girl?
Yeah.. because this is my another channel 😊
@@programsandme congrats ❤️🎉
U are too good in programing 🔥
@@programsandme 😂
@@bdof6528 🗿
😂😂😂
Hi Amulya ji
Wow
ur voice ❤️❤️❤️❤️❤️❤️
Not proper o/p ...
It's coming EOFerror:
Give me the program, I will check 😊
👍👍👍👍
Bro its an not yan
😂😂😂
South Indian
goat
yennnnnnnnnnnnnnnnnnnnnn
Jab koi jyada English bolta hai
To mera dil karta hai...
English me video bana rahe ho
Or mujhe kuch ghanta samajh nahi aara
n is pronounced as yen XD
Good explanation
Thank you!
Usefull