Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. print("Hi, I am Millicent, your personal bot.")
  2. users_name = input("What is your name?")
  3. print("Hello" + users_name)
  4. inputcommand = input("What do you want to do, add or subtract?")
  5. if inputcommand == "add":
  6. input1 = input("Number 1>")
  7. input2 = input("Number 2>")
  8. number1 = int(input1)
  9. number2 = int(input2)
  10. result = number1 + number2
  11. outputstring = str(result)
  12. print("The result is:" + outputstring)
  13. elif inputcommand == "subtract":
  14. input1 = input("Number 1>")
  15. input2 = input("Number 2>")
  16. number1 = int(input1)
  17. number2 = int(input2)
  18. result = number1 - number2
  19. outputstring = str(result)
  20. print("The result is:" + outputstring)
  21. else:
  22. print("Sorry, I don't understand your request")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement