Write A List Comprehension Equivalent For The Python Code Shown #418
Write a list comprehension equivalent for the Python code shown below.</p> <pre><code class="language-python">for i in range(1, 101): if int(i*0.5)==i*0.5: print(i)</code></pre>
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.1.
Write a list comprehension equivalent for the Python code shown below.
for i in range(1, 101): if int(i*0.5)==i*0.5: print(i)
[i for i in range(1, 100) if int(i*0.5)==(i*0.5)]
[i for i in range(1, 101) if int(i*0.5)==(i*0.5)]
[i for i in range(1, 101) if int(i*0.5)=(i*0.5)]
[i for i in range(1, 100) if int(i*0.5)=(i*0.5)]