-2
"[' Food Protected from Contamination', ' Foods are adequately protected from contamination during handling and storage.', 'NA', ' Food Handler Hygiene', ' Food handler hygiene and hand washing is properly followed.', 'NA', 'Temperature & Food Storage', ' Foods are cooked, cooled and stored at proper temperatures.', 'NA', ' Garbage & Waste Handling', ' Garbage and/or waste is properly stored and removed.', 'NA', ' Pest Control', ' Pest control practices are properly maintained.', 'NA', ' Equipment & Utensil Sanitation & Storage', ' Equipment and utensils are properly cleaned, sanitized and maintained.', 'NA', ' Premise Maintenance & Sanitation', ' Food premise is properly maintained in a clean and sanitary condition.', 'NA']"

How do I modify this so that the output would be

[Food Protected from Contamination Foods are adequately protected from contamination during handling and storage. NA Food Handler Hygiene etc....]

In summary I want to remove the apostrophes

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
  • @Pranav Hosangadi this is in a string format, how would i be able to remove it so that I only have a list? – angleofaxis Oct 06 '20 at 16:56
  • https://stackoverflow.com/q/1894269/843953 Please use a good search engine to do some research before asking on Stack Overflow. [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/a/261593/843953) – Pranav Hosangadi Oct 06 '20 at 16:58

1 Answers1

1

Use .join:

' '.join(YOURLIST)
Wasif
  • 14,755
  • 3
  • 14
  • 34
  • yeah but my current is a string where inside is a list. How can I remove the string first before applying this? – angleofaxis Oct 06 '20 at 16:57
  • @angleofaxis take a look at https://stackoverflow.com/questions/1894269/how-to-convert-string-representation-of-list-to-a-list – Wasif Oct 06 '20 at 17:00
  • Questions as basic as this have usually already been asked and answered. In such cases, the recommended course of action is to vote to close / flag as a duplicate. Please don't answer duplicates. – Pranav Hosangadi Oct 06 '20 at 17:03