i’ve been reading from the file and i have hard time getting rid of “\t”
i’ve tried using i.strip().split("\t")[1] and append it to the list. but if theres more tabs in a row it isnt very useful
for example:
if i do what i described i get
z=['\t\t\t\twoman-in-lingerie', 'newspaper-photo', 'reference-to-marie-antoinette', '\tempty-grave', '\t\t\tbased-on-play', '\t\t\tcanadian-humor', '\t\t\tsitcom', 'hypocrisy', 'stripper']
now i dont know how to remove those tabs, ive been trying to get trough the list and change each element on its own bit it was unsuccessful
If you’re just trying to remove tabs you can use this list comprehension:
That’ll get rid of any leading or trailing tabs on each element.