Use tuple index and conditional:
print ('one', 'two', 'none')[0 if a==1 else 1 if a==2 else 2]
Alternatively, if the relation to the index can be an expression:
print ('one', 'two', 'none')[a-1 if a in (1,2) else -1]
You can also combine the tuple index method with dict to get the index, to get something more readable than the direct approach (IMHO):
print ('one', 'two', 'none')[{1:0,2:1}.get(a, -1)]
source share