Lista de compreensão simples exemplo

# for understanding, above generation is same as,
odd_square = []
 
for x in range(1, 11):
    if x % 2 == 1:
        odd_square.append(x**2)
 
print (odd_square)
Outrageous Ostrich