Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # BOT Presentation
- print("Hi, I am Marvin, your personal bot.")
- #input to ask which opetarion you want to do
- command = input("How can I help? ")
- input1 = int(input("Number 1> "))
- input2 = int(input("Number 2> "))
- # if operation is add else substract
- if command == "add":
- print("lets add some numbers")
- result = input1 + input2
- #operates with the input and print result
- print(input1," + " ,input2," = " ,result)
- elif command == "subtract":
- print("lets subtract some numbers")
- #operates with the input and print result
- result = input1 - input2
- print(input1," - " ,input2," = " ,result)
- elif command == "multiply":
- print("lets subtract some numbers")
- #operates with the input and print result
- result = input1 * input2
- print(input1," * " ,input2," = " ,result)
- elif command == "divide":
- print("lets subtract some numbers")
- #operates with the input and print result
- result = input1 / input2
- print(input1," / " ,input2," = " ,result)
- else:
- print("sorry I dont understand")
- #print polite error message in case nothing matchs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement