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)]
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:
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
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:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!