THE SPLIT() FUNCTION WITH FOR LOOPS
Python supports various useful string-related functions, including the split() function and the join() function. The split() function is useful when you want to tokenize (“split”) a line of text into words and then use a for loop to iterate through those words and process them accordingly.
The join() function does the opposite of split(): It “joins” two or more words into a single line. You can easily remove extra spaces in a sentence by using the split() function and then by invoking the join() function, thereby creating a line of text with one white space between any two words.