The comparison you want is the following:
if op == 'sqrt' or op == 'n!':
The issue with your code:
if op == 'sqrt' or 'n!':
is that it always evaluates to true because 'n!'
is a constant truthy value. It does not evaluate what you think it evaluates, it does something like this:
if (op == 'sqrt') or 'n!':
which becomes
if (op == 'sqrt') or True: