Thank you for such a nic explanation! But I have a question (or questions) regarding the code. 1. Which code telling that the pyramid starts from right side? 2. I reckon some code some people write their code like this for i in range(n,0,-1): What is the -1? and not only in the outer loop but also in inner loop!
try this code def print_inverted_left_triangle(total_rows): for row in range(1, total_rows + 1): # display space for space in range(1, (total_rows - row) + 1 ): print(" ", end=" ") # display * for symbol in range(1, row + 1): print(" *", end="") print() total_rows = int(input("Enter the number of rows: ")) print_inverted_left_triangle(total_rows)
You sir, are a legend !!! Thank you so much.
You're welcome!
I promise I see your videos regularly
Thank you so much sir
Pleasure :)
THANK YOU SIR .......😇
You're welcome!
Thank you for such a nic explanation! But I have a question (or questions) regarding the code.
1. Which code telling that the pyramid starts from right side?
2. I reckon some code some people write their code like this
for i in range(n,0,-1):
What is the -1? and not only in the outer loop but also in inner loop!
Thank u more than all stars in the milkey way teacher🙏🙏🙏🌼🌼🌼🌼🌼🌼🌼🌼🌼🌼🌼💖💖💖💖💖💖💖
sir how get space between two star
try this code
def print_inverted_left_triangle(total_rows):
for row in range(1, total_rows + 1):
# display space
for space in range(1, (total_rows - row) + 1 ):
print(" ", end=" ")
# display *
for symbol in range(1, row + 1):
print(" *", end="")
print()
total_rows = int(input("Enter the number of rows: "))
print_inverted_left_triangle(total_rows)
Hi, my solution is:
stars = int(input('Enter the number of stars: '))
for star in range(1,stars+1):
print((stars-star) * ' ' + star * '*')
insanity 🤯
Please bhai can you speak in hindi