Skip to content

Instantly share code, notes, and snippets.

@jarehec
Last active December 31, 2016 03:57
Show Gist options
  • Save jarehec/daa80982c8be1ea18e6a92a279251d66 to your computer and use it in GitHub Desktop.
Save jarehec/daa80982c8be1ea18e6a92a279251d66 to your computer and use it in GitHub Desktop.
numb1 = float(input('first number: '))
op = input('choose an operator: /,*,-,+ ')
numb2 = float(input('second number: '))
if op == '/':
print(numb1 / numb2)
elif op == '*':
print(numb1*numb2)
elif op == '-':
print(numb1 - numb2)
elif op == '+':
print(numb1+numb2)
else:
print('Invalid operator')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment