I'm trying to condense my code a bit and put if-else statements on single lines. When I try and do this for an if-else statement that includes an in-list statement, I get an error.
temperature = 10 if 'hi' in ['hi','2'] else temperature = 1
File "<ipython-input-2-af6c452397be>", line 1
temperature = 10 if 'hi' in ['hi','2'] else temperature = 1
^
SyntaxError: can't assign to conditional expression