Advertisement
rickzman

Untitled

Dec 3rd, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 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, subtract, multiply, divide or area ?")
  13.  
  14.  
  15. if anser == "add":
  16. result = input1 + input2
  17. print(input1, "+", input2, "=", result)
  18. elif anser == "subtract":
  19. result = input1 - input2
  20. print(input1, "-", input2, "=", result)
  21. elif anser == "multiply":
  22. result = input1 * input2
  23. print(input1, "*", input2, "=", result)
  24. elif anser == "divide":
  25. result = input1 / input2
  26. print(input1, "/", input2, "=", result)
  27. elif anser == "area":
  28. result = input1 * input2
  29. print("area of a", input1, "by", input2, "square =", result)
  30.  
  31. else:
  32. print("I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement