Learn

Good! Now let’s take another look at list comprehensions.

squares = [x ** 2 for x in range(5)]

Instructions

1.

Use a list comprehension to create a list, threes_and_fives, that consists only of the numbers between 1 and 15 (inclusive) that are evenly divisible by 3 or 5.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?