{x : x is a whole number less than 20, x is even} (including zero)
a) [x for x in range(1, 20) if (x%2==0)]
b) [x for x in range(0, 20) if (x//2==0)]
c) [x for x in range(1, 20) if (x//2==0)]
d) [x for x in range(0, 20) if (x%2==0)]
What is the list comprehension equivalent for?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What is the list comprehension equivalent for?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!