def compact(lst):
return list(filter(None, lst))
compact ([1,2,3,4,0,"",False,None])
I'm done, but nothing's coming out.
python
Do you want this??
def compact(lst):
return list(filter(None, lst))
print(compact ([1,2,3,4,0,"",False,None]))
© 2024 OneMinuteCode. All rights reserved.