I'm currently learning python and I have to make a calculator which has some scientific operations. Right now I am making a code that detects if it an operation listed or not.
import math
op=input("Type in Operation Here(*,/,-,+, sine, cosine,tangent,**,sqrt,pi)")
if op!= '*',"/",'-','+','sine','cosine','tangent','**','sqrt','pi':
print("Please type in a Operator that is listed above")
elif op== "sine":
sine=float(input("Enter Number for Sine"))
print(math.sin(sine))
elif op== "cosine":
cos=float(input("Enter Number for Cosine"))
print(math.cos(cos))
elif op== "tangent":
tang=float(input("Enter Number for Tang"))
print(math.tan(tang))
elif op=="sqrt":
sqrt=float(input("Enter Number For Square Root:"))
print(math.sqrt(sqrt))
elif op=="pi":
pi=float(input("Enter Number to Pi:"))
print(math.pi*pi)
else:
nub=float(input("Enter Number Here:"))
nub2=float(input("Enter Another Number Here:"))
if op == '+':
print(nub+nub2)
elif op == '-':
print(nub-nub2)
elif op == '*':
print(nub*nub2)
elif op == '/':
print(nub/nub2)
else:
if op =="**":
exp = float(input("Enter Base Here:"))
power = float(input("Enter Power Here:"))
print(exp**power)
When I run the code it has an invalid syntax pointing at line three. Is there a simple way to fix this error?