Examveda

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)

A. [i for i in range(1, 100) if int(i*0.5)==(i*0.5)]

B. [i for i in range(1, 101) if int(i*0.5)==(i*0.5)]

C. [i for i in range(1, 101) if int(i*0.5)=(i*0.5)]

D. [i for i in range(1, 100) if int(i*0.5)=(i*0.5)]

Answer: Option B


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python