Cleanup

Report a typo

List comprehension is an efficient way to create lists. Convert the code below to list comprehension. After conversion, print the list.

square_list = []
for i in range(1, 10):
    if i % 2 == 0:
        square_list.append(i ** 2)
Write a program in Python 3
square_list = [...]
___

Create a free account to access the full topic