Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Calculator program
- x = raw_input ("What would you like to calculate? Addition, Subtraction, Multiplication, or Division?")
- if x == "Addition":
- print "welcome to the addition portion of the calculator"
- ad = input ("What is the first number you would like to add?")
- add = input ("What is the second number you would like to add?")
- ade = ad+add
- print ad, "+", add, "=", ade
- elif x == "Subtraction":
- print "welcome to the subtraction portion of the calculator"
- su = input ("What is the first number you would like to subtract?")
- sub = input ("What is the second number you would like to subtract?")
- sue = su-sub
- print su, "-", sub, "=", sue
- elif x == "Multiplication":
- print "welcome to the multiplication portion of the calculator"
- mu = input ("What is the first number you want to multiply?")
- mul = input ("What is the second number yo want to multiply?")
- mue = mu*mul
- print mu, "*", mul, "=", mue
- elif x == "Division":
- print "welcome to the division portion of the calculator"
- di = input("What is the first number you would like to divide?")
- div = input("What is the second number you would like to divide?")
- die = di/div
- print di, "/", div, "=", die
- else:
- print "That is not a valid entry"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement