可以这样编写程序:list = [] for i in range(50): list.append(random.randint(1,100)) for num in list: if num % 2 != 0: list.remove(num) print(list)
编写程序,生成一个包含50个随机整数的列表,然后删除奇数
猜你喜欢
转载自blog.csdn.net/weixin_35750953/article/details/129536311
今日推荐
周排行