【发布时间】:2021-12-31 11:07:14
【问题描述】:
代码:
num_list = [422, 136, 524, 85, 96, 719, 85, 92, 10, 17, 312, 542, 87,
23, 86, 191, 116, 35, 173, 45, 149, 59, 84, 69, 113, 166]
for items in num_list:
if items % 2 != 0:
print(items)
【问题讨论】:
-
list(filter(lambda x: x%2!=0, num_list))[:5]
标签: python python-3.x list for-loop while-loop