How to use the for loop to delete the elements in the list in Python?

CSDN Q & A 2022-05-14 13:23:22 阅读数:949

useloopdeleteelementslist

img


Solve the problem in the picture , Mainly for Loop to delete list elements, where they don't move , I hope someone can help




Take the answer :
if f in fruit: fruit.remove(f) print(*fruit)else: fruit.append(f) print(*fruit)

版权声明:本文为[CSDN Q & A]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/134/202205072133332897.html