how to get a string with no spaces with for loop in python code example Example: replacing spaces in a string python mystring.replace(" ", "_")