Dec-29-2017, 08:04 PM
A simple calculator, for simple calculations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
print ( "simple calculator by Solstice" ) print ( "I-----I" ) print ( "I00000I" ) print ( "I-----I" ) print ( "I1 2 3I" ) print ( "I4 5 6I" ) print ( "I7 8 9I" ) print ( "I-----I" ) print ( " " ) print ( "when the program asks for +- x : type restart to make some space" ) f = 1 while f = = 1 : c = input ( "+/-/x/:?" ) if c = = "+" : x = input ( "first number " ) y = input ( "number to add " ) z = int (x) + int (y) print (z) input ( "results(Enter to continue)" ) if c = = "-" : x = input ( "first number " ) y = input ( "minus which number? " ) z = int (x) - int (y) print (z) input ( "results(Enter to continue)" ) if c = = "x" : x = input ( "first number " ) y = input ( "times what? " ) z = int (x) * int (y) print (z) input ( "results(Enter to continue)" ) if c = = ":" : x = input ( "first number " ) y = input ( "divided by which number? " ) z = int (x) / int (y) print (z) input ( "results(Enter to continue)" ) if c = = "restart" : print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( " " ) print ( "===========================================================" ) print ( "I New calculation I" ) print ( "===========================================================" ) |