i am trying to write some string to a file but without quotes.
i check other solutions online but none of them worked for me.
so i am reading from a list and trying to write item to a output.
i tried to map and do item[1:-1] but none of them worked
this my code:
for item in sorted(wrong_blocks):
You can remove all instances of a given set of characters from either side of a string with
>>> s = '''"hello!"'''.strip('!"') >>> print(s) hello
output.write call to
output.write(str(item).strip('"')) and it will remove any unwanted quotes.