Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. #Calculator program
  2. x = raw_input ("What would you like to calculate? Addition, Subtraction, Multiplication, or Division?")
  3. if x == "Addition":
  4.     print "welcome to the addition portion of the calculator"
  5.     ad = input ("What is the first number you would like to add?")
  6.     add = input ("What is the second number you would like to add?")
  7.     ade = ad+add
  8.     print ad, "+", add, "=", ade
  9. elif x == "Subtraction":
  10.     print "welcome to the subtraction portion of the calculator"
  11.     su = input ("What is the first number you would like to subtract?")
  12.     sub = input ("What is the second number you would like to subtract?")
  13.     sue = su-sub
  14.     print su, "-", sub, "=", sue
  15. elif x == "Multiplication":
  16.     print "welcome to the multiplication portion of the calculator"
  17.     mu = input ("What is the first number you want to multiply?")
  18.     mul = input ("What is the second number yo want to multiply?")
  19.     mue = mu*mul
  20.     print mu, "*", mul, "=", mue
  21. elif x == "Division":
  22.     print "welcome to the division portion of the calculator"
  23.     di = input("What is the first number you would like to divide?")
  24.     div = input("What is the second number you would like to divide?")
  25.     die = di/div
  26.     print di, "/", div, "=", die
  27. else:
  28.     print "That is not a valid entry"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement