Complete Python Bootcamp From Zero To Hero -

squares = [x**2 for x in range(10)] print(squares) # Same result, 66% less code.

squares = [] for x in range(10): squares.append(x**2) print(squares) # [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] complete python bootcamp from zero to hero

even_squares = [x**2 for x in range(10) if x % 2 == 0] # [0, 4, 16, 36, 64] Write a list comprehension that takes words = ["cat", "elephant", "rat", "tiger"] and returns a new list containing only words longer than 3 letters, in uppercase. squares = [x**2 for x in range(10)] print(squares)