Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. print("Hi, I am your mathbot")
  2. my_name=input("What's your name? ")
  3. print("Nice meeting you, "+my_name)
  4. operation=input("Would you like to practice addition/subtraction/multiplication/division? Enter A or S or M or D : ")
  5. if (operation=="A" or operation=="a"):
  6. num1=int(input("Enter the first number "))
  7. num2=int(input("Enter the second number "))
  8. result= num1+num2
  9. print(str(num1) + "+" +str(num2)+ "="+ str(result))
  10. elif(operation=="S" or operation=="s"):
  11. num1=int(input("Enter the first number "))
  12. num2=int(input("Enter the second number "))
  13. result= num1-num2
  14. print(str(num1) + "-" +str(num2)+ "="+ str(result))
  15. elif(operation=="M" or operation=="m"):
  16. num1=int(input("Enter the first number "))
  17. num2=int(input("Enter the second number "))
  18. result= num1*num2
  19. print(str(num1) + "*" +str(num2)+ "="+ str(result))
  20. elif(operation=="D" or operation=="d"):
  21. num1=int(input("Enter the first number "))
  22. num2=int(input("Enter the second number "))
  23. result=float( num1/num2)
  24. print(str(num1) + "/" +str(num2)+ "="+ str(result))
  25. else:
  26. print("Let's pratice math some other time. Bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement