Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hello, my name is calculator! And what about you? ")
- name = input( "My name is: ")
- name1 = "Andrew"
- if name != name1:
- print('Error')
- exit(0)
- what = input( "what we doing? (+,-,*,/,**,%,//): " )
- a = float( input( "Write first number: ") )
- b = float( input( "Write second number: ") )
- c = None
- if what == "+":
- c = a + b
- elif what == "-":
- c = a - b
- elif what == "*":
- c = a * b
- elif what == "/":
- c = a / b
- elif what == "**":
- c = a ** b
- elif what == "%":
- c = a % b
- elif what == "//":
- c = a // b
- if c:
- print("equals: ",c)
- else:
- print("Invalid action")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement