Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I'm Marvin, your personal assistant.")
- your_name = input("What's your name?\n")
- print("Welcome " + your_name + "!")
- opr = input("How may I assist you with?\n")
- if opr == "add" or opr == "Add":
- num1 = input("Enter first number.\n")
- num2 = input("Enter second number.\n")
- result = int(num1) + int(num2)
- output = str(result)
- print(num1 + "+" + num2 + "=" + output)
- elif opr == "substract" or opr == "Substract":
- num1 = input("Enter first number.\n")
- num2 = input("Enter second number.\n")
- result = int(num1) - int(num2)
- output = str(result)
- print(num1 + "-" + num2 + "=" + output)
- elif opr == "multiply" or opr == "Multiply":
- num1 = input("Enter first number.\n")
- num2 = input("Enter second number.\n")
- result = int(num1) * int(num2)
- output = str(result)
- print(num1 + "*" + num2 + "=" + output)
- elif opr == "divide" or opr == "Divide":
- num1 = input("Enter first number.\n")
- num2 = input("Enter second number.\n")
- result = int(num1) / int(num2)
- output = str(result)
- print(num1 + "/" + num2 + "=" + output)
- else:
- print("I'm not capable of doing " + opr + " at the moment. You should keep upgrading me.")
Advertisement
Add Comment
Please, Sign In to add comment