Advertisement
182days

Calculator (Chugs)

May 10th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.42 KB | None | 0 0
  1. print("Welcome to the Chugs Calculator")
  2. print("Your Options are:")
  3. print()
  4. print("1) Addition")
  5. print("2) subtraction")
  6. print("3) Multiplication")
  7. print("4) Division")
  8. print("5) Area of circle")
  9. print("6) Exit")
  10.  
  11.  
  12. loop=1
  13.  
  14. while loop==1:
  15.     choice=input("Choose your option")
  16.     choice=int(choice)
  17.     if choice == 1:
  18.         add1=input("Enter your first number:")
  19.         add2=input("Enter your second number:")
  20.         add1=int(add1)
  21.         add2=int(add2)
  22.         print(add1, "+",add2,"=",add1+add2)
  23.     elif choice== 2:
  24.         sub1=input("Enter your first number:")
  25.         sub2=input("Enter your second number:")
  26.         sub1=int(sub1)
  27.         sub2=int(sub2)
  28.         print(sub1, "-",sub2,"=",sub1-sub2)
  29.     elif choice== 3:
  30.         mul1=input("Enter your first number:")
  31.         mul2=input("Enter your second number:")
  32.         mul1=int(mul1)
  33.         mul2=int(mul2)
  34.         print(mul1, "*",mul2,"=",mul1*mul2)
  35.     elif choice== 4:
  36.         div1=input("Enter your first number:")
  37.         div2=input("Enter your second number:")
  38.         div1=int(div1)
  39.         div2=int(div2)
  40.         print(div1, "/",div2,"=",div1/div2)
  41.     elif choice==5:
  42.         rad1=input("What is the radius of the circle")
  43.         rad1=int(rad1)
  44.         pi=3.1428
  45.         print("Area of circle with radius",rad1,"=",pi*(rad1**2))
  46.     elif choice==6:
  47.               loop=0
  48.     else:
  49.         print("Enter a value from 1 to 5")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement