Skip to content

Instantly share code, notes, and snippets.

@hahalim
Last active December 27, 2018 00:04
Show Gist options
  • Save hahalim/fe106e52f2ae6a2ff7388a210edafb2a to your computer and use it in GitHub Desktop.
Save hahalim/fe106e52f2ae6a2ff7388a210edafb2a to your computer and use it in GitHub Desktop.
Asterisk triangle
chance = ""
while(chance!="no"):
try:
num = int(input("Enter the number of rows "))
for i in range(1, num+1):
for j in range(num-i, num):
print("*", end="")
print()
except ValueError:
print("Enter the valid number")
chance = input("press any key to run the program again type no to exit [yes]/no ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment