Created
October 13, 2020 22:22
8 Levels of Using List Comprehension in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 1 | |
b = 2 if a>0 # SyntaxError: invalid syntax | |
b = 2 if a > 0 else -1 | |
# b==2,ternary conditional operator works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment