Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- print("Hi, my am marvin, your personal bot.")
- users_name = input("What is your name? ")
- print("Welcome "+ users_name)
- #print("Let's add or subtract some numbers")
- input1 = float(input("Number 1> "))
- input2 = float(input("Number 2> "))
- # add or subtract??
- anser = input("Do you want to add, subtract, multiply, divide or area ?")
- if anser == "add":
- result = input1 + input2
- print(input1, "+", input2, "=", result)
- elif anser == "subtract":
- result = input1 - input2
- print(input1, "-", input2, "=", result)
- elif anser == "multiply":
- result = input1 * input2
- print(input1, "*", input2, "=", result)
- elif anser == "divide":
- result = input1 / input2
- print(input1, "/", input2, "=", result)
- elif anser == "area":
- result = input1 * input2
- print("area of a", input1, "by", input2, "square =", result)
- else:
- print("I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement