In the above code, why exactly do we need the following statements:
I'm assuming it's something to do with the way split words because in my code, I didn't have those statements and I wasn't getting the correct answer - the extra spaces weren't getting removed.
So I think the issue is that I'm not completely clear on how s.split(" ") works.
Thank you for your help!
Please check this link for the usage of split( )