Write A List Comprehension For Producing A List Of Numbers #437
Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 List Comprehension - Python List Comprehension - Quiz No.3.
Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.
[x in range(1, 1000) if x%3==0]
[x for x in range(1000) if x%3==0]
[x%3 for x in range(1, 1000)]
[x%3=0 for x in range(1, 1000)]