['a' if i % 2 == 0 else 'b' for i in range(10)]
I was only aware of code like
['a' for i in range(10) if i % 2 == 0]
I was only aware of code like