Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hello there. My name is Marvin and I'm your personal bot.")
- user_name=input("What's your name?")
- print("Hello " + user_name + " and welcome.")
- command = input("What can I help you with?")
- if command == "add" or command == "subtract" or command == "multiply" or command == "divide" :
- print("Let's " + command + " some numbers.")
- input1=input("Number1 > ")
- input2=input("Number2 > ")
- number1=int(input1)
- number2=int(input2)
- result=number1+number2
- output=str(result)
- print(input1 + "+" + input2 + "=" + output)
- print("Now we can try a multiplication.")
- input3=input("Number3 > ")
- input4=input("Number4 > ")
- number3=int(input3)
- number4=int(input4)
- result=number3*number4
- output=str(result)
- print(input3 + "*" + input4 + "=" + output)
- print("And now a division.")
- input5=input("Number5 > ")
- input6=input("Number6 > ")
- number5=int(input5)
- number6=int(input6)
- result=number5/number6
- output=str(result)
- print(input5 + "/" + input6 + "=" + output)
- print("Finally let's try finding the area of a rectangle. You will need to give me the lengths of the two different sides.")
- input7=input("Number7 > ")
- input8=input("Number8 > ")
- number7=float(input7)
- number8=float(input8)
- result=number7*number8
- output=str(result)
- print(input7 + "*" + input8 + "=" + output + " sq.m")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement