2021年9月1日
摘要: 定义列表list_1,使用for循环删除列表中的偶数元素,即能被2整除的元素,代码如下: # coding: utf-8list_1 = [3, 6, 8, 9, 25, 36, 100, 105]for item in list_1: if item % 2 ==0: list_1.remove( 阅读全文
posted @ 2021-09-01 16:37 beyondhd 阅读(725) 评论(0) 推荐(0) 编辑