Advertisement
braconnier

bot2-14.py

Nov 26th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. print("Hi, I am Marvin, your personal bot")
  2. command = input("How can I help ? ")
  3. if command =="add"or command == "plus" or command == "+":
  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.  
  13. elif command == "substract" or command == "-":
  14. print ("lets substract some numbers")
  15. input1 = input("Number 1> ")
  16. input2 = input("Number 2> ")
  17. number1 = int(input1)
  18. number2 = int(input2)
  19. result = number1 - number2
  20. output = str(result)
  21. print (input1 + " - " + input2+ " = " + output )
  22.  
  23. elif command == "divide" or command == "/":
  24. print ("lets divide some numbers")
  25. input1 = input("Number 1> ")
  26. input2 = input("Number 2> ")
  27. number1 = int(input1)
  28. number2 = int(input2)
  29. result = number1 / number2
  30. output = str(result)
  31. print (input1 + " / " + input2+ " = " + output )
  32.  
  33. elif command == "multiply" or command == "x":
  34. print ("lets multiply some numbers")
  35. input1 = input("Number 1> ")
  36. input2 = input("Number 2> ")
  37. number1 = int(input1)
  38. number2 = int(input2)
  39. result = number1 * number2
  40. output = str(result)
  41. print (input1 + " x " + input2+ " = " + output )
  42.  
  43. elif command == "volume" or command == "vol":
  44. print("Volume of your swimming pool")
  45. print ("lets give : length; width and depth ")
  46. input1 = input("length > ")
  47. input2 = input("width > ")
  48. input3 = input("depth > ")
  49. number1 = int(input1)
  50. number2 = int(input2)
  51. number3 = int(input3)
  52. result = number1 * number2 + number3
  53. output = str(result)
  54. print (input1 + " m" +" x " + input2 + " m" +" x " + input3 +" m"+" = " + output +" m3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement