Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. print("Hi, I am BoBo your personnal Bot!")
  2. print("How can I help?")
  3. #choisir l'opération
  4. op_name =input()
  5. # addition
  6. #test l'entrée
  7. if op_name == "add" or op_name == "Add" or op_name == "+" :
  8. print("It's time to add :)")
  9. #premier nombre
  10. input1 = int(input("give me a first number1"))
  11. #second nombre
  12. input2 = int(input("give me a second number2"))
  13. #addition
  14. result = int(input1 + input2)
  15. print ("the result is "+ str(result))
  16. #soustraction
  17. elif op_name == "subtract" or op_name == "Substract" or op_name == "-":
  18. print("It's time to substract :)")
  19. #entrée premier nombre
  20. input1 = int(input("give me a first number1"))
  21. #entrée second nombre
  22. input2 = int(input("give me a second number2"))
  23. #calcul soustraction
  24. result = int(input1 - input2)
  25. print ("the result is "+ str(result))
  26. elif op_name == "multiply" or op_name == "Multiply" or op_name == "x":
  27. print("It's time to multiply :)")
  28. #entrée premier nombre
  29. input1 = int(input("give me the first number1"))
  30. #entrée second nombre
  31. input2 = int(input("give me a second number2"))
  32. #calcul multiplication
  33. result = int(input1 * input2)
  34. print ("the result is "+ str(result))
  35. #autre
  36. else :
  37. print("Sorry, I can't help you! bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement