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)
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()
# 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
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 the short code that I have never seen in another videos and websites
Ty bro, was about to give up ❤
Excellent explanation of logic the best channel for learning about patterns
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()
Thank you very much 👍 very easy and simple
You are welcome 😊
Wah bete mauj kardi.
Very Good explanation sister 😊
Thnks mam what a wonderful and simple explanation ❤
Wow th way of explaining pyramid star very nice
This is really an excellent channel on Python like "techie talkee"
Thank you :)
Thanks for everything mam😌😌👌
Most welcome :)
Thank you mam.. This is the best video i got ❤
Great explanation with a beautiful voice.Thanks
this was more good than our teacher
You got one more subscriber 😊 Thanks very helpful
Is it amulyas channel.Didnt know.Gonna subscribe
Thank you :)
Very helpful tutorial
thank you 😊
You are the best ❤
like your videos and voice tooo👍❣
what an awesome explanation
Awesome Video and Good Explanation
Simple explanation
is it compulsory to take j can we use other alphabets
Yes you can :)
Is it possible to print an isosceles triangle?
Give me the pattern :)
this is an iscosceles already bro
Amazingly Explained thanks
What a nice explanation!!!
Excellent I understood please help in fubunocci
Which platform is she using here?
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
bro thanks very good video
Nice explanation
thanks a lot
your voice is very nice
Loved your explanation..
Hats off super mam
Thanks
good explanation madam
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.
Thanks ❤ dear
Welcome :)
ты самая лучшая женщина на свете
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
Good explanation 😁
Thank you 😊
thankyou all doubt clear
Thank you!
U voice match with amulya academy girl?
Yeah.. because this is my another channel 😊
@@programsandme congrats ❤️🎉
U are too good in programing 🔥
@@programsandme 😂
@@bdof6528 🗿
😂😂😂
U voice is like amulya academy only
This is Amulya academy second RUclips channel only
why do indians say 'only' after every sentence
Thank you.
apka dhanyawaad
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()
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
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)
Wow
ur voice ❤️❤️❤️❤️❤️❤️
Thanks madam 😊
Not proper o/p ...
It's coming EOFerror:
Give me the program, I will check 😊
i have an doubt
👍👍👍👍
Ur amulya academi right
Thnx mam
Mera issi code se kuch or hi print kr rhaa h
Hi Amulya ji
goat
South Indian
Jab koi jyada English bolta hai
To mera dil karta hai...
English me video bana rahe ho
Or mujhe kuch ghanta samajh nahi aara
yennnnnnnnnnnnnnnnnnnnnn
Bro its an not yan
😂😂😂
n is pronounced as yen XD
Good explanation
Usefull
Thank you!