Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #introduce yourself as their personal bot
- print("Hi I am Amma, your personal bot.")
- command =input("How canI help?")
- # choose acommand to add
- if command =="add":
- print("let's 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 =="subtract":
- print("Let's 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)
- # choose a command to multiply
- elif command =="multiply":
- print("Let's 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)
- #choose a command to divide
- elif command =="divide":
- print("Let's 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)
- #if neithe add or subtract is chosen the message "I don't understand will be displayed
- else:
- print("sorry, I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement