Advertisement
GreatRaymondo

itemchal

May 13th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. print("Hi im Mr Biddle, im your personal bot")
  2. command = input("How can I help? ")
  3. if command == "add":
  4. print("lets add some numbers")
  5. input1 = input("Number 1> ")
  6. input2 = input("Number 2> ")
  7. input3 = input("Number 3> ")
  8. number1 = int(input1)
  9. number2 = int(input2)
  10. number3 = int(input3)
  11. result = number1 + number2 + number3
  12. output = str(result)
  13. print(input1 + " + " + input2 + " + " + input3 + " = " + output)
  14. elif command == "subtract":
  15. print("Lets subtract some numbers")
  16. input1 = input("Number 1> ")
  17. input2 = input("Number 2> ")
  18. number1 = int(input1)
  19. number2 = int(input2)
  20. result = number1 - number2
  21. output = str(result)
  22. print(input1 + " - " + input2 + " = " + output)
  23. elif command == "multiply":
  24. print("Lets multiply 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. elif command == "area":
  33. print("lets find out the area of this room")
  34. input1 = input("length> ")
  35. input2 = input("width> ")
  36. number1 = int(input1)
  37. number2 = int(input2)
  38. result = number1 * number2
  39. output = str(result)
  40. print(input1 + " * " + input2 + " = " + output)
  41. elif command == "average":
  42. how_many = input("how many numbers> ")
  43. how_many = int(how_many)
  44. total = 0
  45. for number_count in range(how_many):
  46. number = input("Enter number " + str(number_count) + ">")
  47. total = total + int(number)
  48. result = total / how_many
  49. print("the average = " + str(result))
  50. elif command=="shopping":
  51. shopping=[]
  52. how_many=input("How many items do you have in your shopping list")
  53. how_many=int(how_many)
  54. for item_number in range(how_many):
  55. item=input("what is item number " + str(item_number) + "?")
  56. shopping.append(item)
  57. for item in shopping:
  58. print(item)
  59. total=len(shopping)
  60. print("you have "+str(total)+" items in your shopping list")
  61.  
  62. else:
  63. print("sorry I dont have a scooby")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement