Advertisement
rickzman

Untitled

Dec 3rd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #
  2. print("Hi, my am marvin, your personal bot.")
  3. users_name = input("What is your name? ")
  4. print("Welcome "+ users_name)
  5.  
  6.  
  7. #print("Let's add or subtract some numbers")
  8. input1 = float(input("Number 1> "))
  9. input2 = float(input("Number 2> "))
  10.  
  11. # add or subtract??
  12. anser = input("Do you want to add or subtract?")
  13.  
  14. if anser == "add":
  15. result = input1 + input2
  16. print(input1, "+", input2, "=", result)
  17. elif anser == "subtract":
  18. result = input1 - input2
  19. print(input1, "-", input2, "=", result)
  20. else:
  21. print("I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement