Advertisement
lubattillah

add

May 11th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. print("Hi, I am Khamisi, your personal bot.")
  2. command=input("How can I help? ")
  3. if command=="add":
  4. input1 = input("Number 1> ")
  5. input2 = input("Number 2> ")
  6. number1 = int(input1)
  7. number2 = int(input2)
  8. result = number1+number2
  9. output = str(result)
  10. print(input1+" "+"+"+" "+input2+" "+"="+" "+output)
  11. elif command=="+":
  12. input1 = input("Number 1> ")
  13. input2 = input("Number 2> ")
  14. number1 = int(input1)
  15. number2 = int(input2)
  16. result = number1+number2
  17. output = str(result)
  18. print(input1+" "+"+"+" "+input2+" "+"="+" "+output)
  19. else:
  20. print("No such kind of an operation")
  21. print("This is how we can add two numbers")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement