Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- clear = lambda: os.system('cls')
- while 1:
- usr_input = str(raw_input("To calculate the faculty of a given number\nenter a positive interger.\nEnter <0> to quit.\n> "))
- if (usr_input == "0"):
- print "Good Bye!"
- exit(1)
- elif (usr_input != None):
- result = 1
- for i in range(1, int(usr_input)):
- result = result * i
- print "Summary of the last calculation:\n\tGiven input: %d\n\tFaculty of input: %d\n" % (int(usr_input), result)
- else:
- print "You fucked up"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement