A program that takes user input and draws pattern of astrologer's stars
while True:
try:
print("How many rows of stars you want?")
nr = int(input())
except:
print("Wrong input! Only numbers allowed.")
continue
print("""Keys:
Just press Enter for inverted pattern or
Type anything and press Enter for upright pattern.""")
tf = bool(input())
i=0
if tf == True:
while i<nr:
print("*"*(i+1))
i+=1
else:
while i<nr:
print("*"*(nr-i))
i+=1
Comments
Post a Comment
Write something to CodeWithAbdur!