operation = (input('Please enter what operation you would like to do, / is divide, * is multiply, + is plus and - is minus')
You forgot to add a second closing brace. In this case, just remove the opening brace.
Additionally, your if
statement will always be True. Following code will work:
if not operation in ['/', '*', '+', '-']: # test if operation is one of /, *, + and -
print('not a valid answer, try again')
operation = input('Please enter what operation you would like to do, / is divide, * is multiply, + is plus and - is minus')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…