SyntaxFix
Write A Post
Hire A Developer
Questions
replace() does not operate in-place, you need to assign its result to something. Also, for a more concise syntax, you could supplant your for loop with a one-liner: hello_no_spaces = map(lambda x: x.replace(' ', ''), hello)
hello_no_spaces = map(lambda x: x.replace(' ', ''), hello)