Advertisement
Guest User

New Paste

a guest
Nov 23rd, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. ''' make a fucking calculator, the fuck'''
  2. #time to add shit up bitch
  3. def add(x, y):
  4. return x + y
  5.  
  6. # subtracting shit now
  7. def subtract(x, y):
  8. return x - y
  9. #we gonna multiply now muthafucka
  10. def multiply(x, y):
  11. return x * y
  12. #time to divide THIS SHIT
  13. def divide(x, y):
  14. return x / y
  15. print("Select Operation.")
  16. print("1.add")
  17. print ("2.subtract")
  18. print ("3.Multiply")
  19. print ("4.Divide")
  20.  
  21. #time to give directions bitch
  22.  
  23. choice = input("enter choice (1/2/3/4):")
  24. num1 = int(input("enter first number: "))
  25. num2 = int(input("enter second number: "))
  26. if choice == '1':
  27. print(num1,"+",num2,"=", add(num1,num2))
  28. elif choice == '2':
  29. print(num1,"-",num2,"=", subtract(num1,num2))
  30. elif choice == '3':
  31. print(num1,"*",num2,"=", multiply(num1,num2))
  32. elif choice == '4':
  33. print(num1,"/",num2,"=", divide(num1,num2))
  34. else:
  35. print("invalid input")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement