Advertisement
Adm1n_0v3rride

calcuator

Nov 10th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. greeting = "Welcome to the calcuator\n"
  4.  
  5. print(greeting)
  6.  
  7. print("1. addition\n")
  8.  
  9. print("2. subtraction\n")
  10.  
  11. print("3. multiplication\n")
  12.  
  13. print("4. division\n")
  14.  
  15. choice = int(input("Please make a selection: "))
  16.  
  17. if(choice == 1):
  18.  
  19.   a = int(input("first #:  "))
  20.  
  21.   b = int(input("secound #:  "))
  22.  
  23.   sum = a + b
  24.  
  25.   print(sum)
  26.  
  27. if choice == 2:
  28.    
  29.       c = int(input("first #:  "))
  30.      
  31.       d = int(input("secound #:  "))
  32.      
  33.       subtraction = c - d
  34.      
  35.       print(subtraction)
  36.      
  37. elif choice == 3:
  38.          
  39.           e = int(input("first #:  "))
  40.          
  41.           f = int(input("secound #:  "))
  42.          
  43.           multiplication = f * e
  44.          
  45.           print(multiplication)
  46.          
  47. elif choice == 4:
  48.              
  49.               g = int(input("first #:  "))
  50.              
  51.               h = int(input("secound #:  "))
  52.              
  53.               division = h / g
  54.              
  55.               print(division)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement