LoveHecate

[PYTHON] FULL Calculator w/ 60s Timer v2

Jul 23rd, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.22 KB | None | 0 0
  1. #!/usr/bin/python
  2. #Coded By: Love Hecate
  3.  
  4. import time
  5.  
  6. try:
  7.     while True:
  8.        option = raw_input("Type?: ")
  9.  
  10.        if option == "addition":
  11.           a = input ("first number: ")
  12.           b = input ("second number: ")
  13.           done = str (a + b)
  14.           print ("\n")
  15.           print ("The Answer is: " ""+done+"")
  16.           break
  17.  
  18.        elif option == "subtraction":
  19.           c = input ("first number: ")
  20.           d = input ("second number: ")
  21.           done = str (c - d)
  22.           print ("\n")
  23.           print ("The Answer is: " ""+done+"")
  24.           break
  25.          
  26.        elif option == "floordivision":
  27.           e = input ("Enter First Number: ")
  28.           f = input ("Enter Second Number: ")
  29.           done = str (e // f)
  30.           print ("\n")
  31.           print ("The Answer is: " ""+done+"")
  32.           break
  33.  
  34.        elif option == "modulo":
  35.           g = input ("Enter First Number: ")
  36.           h = input ("Enter Second Number: ")
  37.           done = str (g % h)
  38.           print ("\n")
  39.           print ("The Answer is: " ""+done+"")
  40.           break
  41.  
  42.  
  43.        elif option == "division":
  44.           i = input ("Enter First Number: ")
  45.           j = input ("Enter Second Number: ")
  46.           done = str (i / j)
  47.           print ("\n")
  48.           print ("The Answer is: " ""+done+"")
  49.           break
  50.  
  51.  
  52.        elif option == ("timer"):
  53.           print ("CTRL + C TO EXIT")
  54.           i = 1
  55.           while i <=60:
  56.             print(i)
  57.             time.sleep (1)
  58.             i = i + 1
  59.           print ("Stop Watch Coded By: Love Hecate")
  60.    
  61.        else:
  62.           print ("Invalid Option")
  63.           print ("Usage: addition, subtraction, floordivision, modulo, division, timer")
  64.  
  65. except KeyboardInterrupt:
  66.   print ("\n")
  67.   print ("\x1b[1;35m    _    (^)            ")
  68.   print ("   (_\   |_|                      ")
  69.   print ("    \_\  |_|                      ")
  70.   print ("    _\_\,/_|                      ")
  71.   print ("   (`\(_|`\|                      ")
  72.   print ("  (`\,)  \ \'                     ")
  73.   print ("   \,)   | |                      ")
  74.   print ("     \__(__|\x1b[0m               ")
  75.   print ("Wow... You're a slut whatever BYE!")
  76.   print ("\n                                ")
Advertisement
Add Comment
Please, Sign In to add comment