Jun-09-2018, 08:38 AM
(Jun-09-2018, 05:00 AM)perfringo Wrote: Slicing can be used in list comprehension as well:Yes, it can - only in that case list comprehension is redundant
without_header = [row for row in my_list[1:]]
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.