Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi im Mr Biddle, im your personal bot")
- command = input("How can I help? ")
- if command == "add":
- print("lets add some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- input3 = input("Number 3> ")
- number1 = int(input1)
- number2 = int(input2)
- number3 = int(input3)
- result = number1 + number2 + number3
- output = str(result)
- print(input1 + " + " + input2 + " + " + input3 + " = " + output)
- elif command == "subtract":
- print("Lets subtract some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 - number2
- output = str(result)
- print(input1 + " - " + input2 + " = " + output)
- elif command == "multiply":
- print("Lets multiply some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 * number2
- output = str(result)
- print(input1 + " * " + input2 + " = " + output)
- elif command == "area":
- print("lets find out the area of this room")
- input1 = input("length> ")
- input2 = input("width> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 * number2
- output = str(result)
- print(input1 + " * " + input2 + " = " + output)
- elif command == "average":
- how_many = input("how many numbers> ")
- how_many = int(how_many)
- total = 0
- for number_count in range(how_many):
- number = input("Enter number " + str(number_count) + ">")
- total = total + int(number)
- result = total / how_many
- print("the average = " + str(result))
- elif command=="shopping":
- shopping=[]
- how_many=input("How many items do you have in your shopping list")
- how_many=int(how_many)
- for item_number in range(how_many):
- item=input("what is item number " + str(item_number) + "?")
- shopping.append(item)
- for item in shopping:
- print(item)
- total=len(shopping)
- print("you have "+str(total)+" items in your shopping list")
- else:
- print("sorry I dont have a scooby")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement