one line python code example
Example 1: one-line for loop python
[thing for thing in list_of_things]
Example 2: one line if statement python
var = [expression1] if [condition] else [expression2]
Example 3: python code in 1 line
exec("try: \n \t if sam[0] != 'harry': \n \t\t print('hello', sam) \nexcept: pass")