Programming and Problem Solving through Python : Sequence data types in python

1 और 1000 के बीच नंबर्स की लिस्ट बनाने के लिए एक लिस्ट लिखें, जो 3 से डिविजिबल हैं। , Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.

Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.




Solution
B. [x for x in range(1000) if x%3==0]



Explanation
The list comprehension [x for x in range(1000) if x%3==0] produces a list of numbers between 1 and 1000 that are divisible by 3.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad