I have a list of string in python.
header_row = ['column 1', 'column 2', 'column 3']
I want to replace the empty space with underscore. The converted list will look like this;
converted_header_row = ['column_1', 'column_2', 'column_3']
The conversion can be done individually with the line below;
mystring.replace(" ", "_")
How do I iterate this replacement operation through all the strings in the list? I welcome any other method to do the conversion.
I am using python v3.6