Advertisement
elena_gancedo

Subtracting

Jun 22nd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. print("Hi, I am Eley, your personal bot.")
  2. command = input("How can I help? ")
  3. if command == "add" or command == "plus":
  4.     print("lets add some numbers")
  5.     input1 = input("Number 1> ")
  6.     input2 = input("Number 2> ")
  7.     number1 = int(input1)
  8.     number2 = int(input2)
  9.     result = number1 + number2
  10.     output = str(result)
  11.     print(input1 + " + " + input2 + " = " + output)
  12. command1 = input("Let's do a subtraction with the result of the sum: ")
  13. if command1 == "let's do it" or command1 == "all right":
  14.     print("lets subtract some numbers")
  15.     input3 = input("Number 3> ")
  16.     number3 = int(input3)
  17.     number4 = int(output)
  18.     print(number4)
  19.     result1 = number3 - number4
  20.     output1 = str(result1)
  21.     print(input3 + " - " + output + " = " + output1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement