Skip to content

Instantly share code, notes, and snippets.

@code2be
Created September 8, 2022 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code2be/20eebac21cf01d66d2c74524c12c55ef to your computer and use it in GitHub Desktop.
Save code2be/20eebac21cf01d66d2c74524c12c55ef to your computer and use it in GitHub Desktop.
simple_calc.py
x = float(input("Enter first number"))
y = float(input("Enter second number"))
o = input("Enter operator") # + - / * %
if o == "+":
print(x + y)
elif o == "-":
print(x - y)
elif o == "*":
print(x * y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment