squares_cubes = [n**2 if n%2 == 0 else n**3 for n in range(1,11)] print(squares_cubes) ''' [1, 4, 27, 16, 125, 36, 343, 64, 729, 100] '''