userInput = int(input("Please enter the amount of rows: 5 ")) row = 0 while(row < userInput): row += 1 spaces = userInput - row spaces_counter = 0 while(spaces_counter < spaces): print(" ", end ='') spaces_counter += 1 num_stars = 2*row-1 while(num_stars > 0): print("*", end ='') num_stars -= 1 print()
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more