Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Marvin, your personal bot")
- command = input("How can I help ? ")
- if command =="add"or command == "plus" or command == "+":
- print ("lets add 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 == "substract" or command == "-":
- print ("lets substract 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 == "divide" or command == "/":
- print ("lets divide 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" or command == "x":
- 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 + " x " + input2+ " = " + output )
- elif command == "volume" or command == "vol":
- print("Volume of your swimming pool")
- print ("lets give : length; width and depth ")
- input1 = input("length > ")
- input2 = input("width > ")
- input3 = input("depth > ")
- number1 = int(input1)
- number2 = int(input2)
- number3 = int(input3)
- result = number1 * number2 + number3
- output = str(result)
- print (input1 + " m" +" x " + input2 + " m" +" x " + input3 +" m"+" = " + output +" m3")
- 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+1) + " > ")
- total = total + int(number)
- result = total / how_many
- print ("the average = " + str(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement