Skip to content

Instantly share code, notes, and snippets.

@ebovio
Created April 16, 2017 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebovio/cbfaf84fe4bb7a2a1ed447e8bde78f8e to your computer and use it in GitHub Desktop.
Save ebovio/cbfaf84fe4bb7a2a1ed447e8bde78f8e to your computer and use it in GitHub Desktop.
#Problem3
def factorial():
n = int(input("Please enter a non-negative integer:"))
counter = 0
result = 1
while counter <= n-1:
counter = counter + 1
result = result * counter
else:
print ("The factorial of the number you provide is", result)
#MainProgramBelow
while True:
factorial()
print("Y = Yes"); print("N = No")
again= input("Would you like to continue?")
if again == 'n':
print("Have a nice day")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment