image = ‘clouds.png’ if waster == ‘Clouds’ else ‘rain.png’ ‘clear.png’ if waster == ‘Clear’
можно ли тут использовать elif?
>>> a = 1 >>> b = 2 >>> if a > b: ... x = 'a' * n ... else: ... x = n ... Traceback (most recent call last): File "<stdin>", line 4, in <module> NameError: name 'n' is not defined >>>
>>> a = 1; b = 2; x = 'a' * n if a > b else n Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'n' is not defined >>>