python 列表随机删除一个元素,代码如下:import randomli = [1,2,3,4]li.remove(random.choice(li)) #随机删除列表li中的任意一个元素print(li) #结果肯定不是none.
list.remove()方法没有返回值。