Advertisement
TheSTRIG

shapes

Jul 29th, 2021
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. # input_width = input("Input width: ")
  2. # input_height = input("Input height: ")
  3. # width = int(input_width)
  4. # height = int(input_height)
  5.  
  6. # if width < 1 or height < 1:
  7. #     print("you cannot do that")
  8.  
  9. # while height > 0:
  10. #     print("*" * width)
  11. #     height -= 1
  12. i = 1
  13. while i > 0:
  14.     bintang = 1
  15.     input_level = input("Pyramid level: ")
  16.     if input_level == "stop":
  17.         break
  18.     level = int(input_level)
  19.    
  20.     if level < 2:
  21.         print("That's not a pyramid!")
  22.     else:
  23.         while level > 0:
  24.             print(" " * (level - 1) + "*" * bintang)
  25.             bintang += 2
  26.             level -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement