Complete the code to split the text into words using spaces.
words = text[1](" ")
The split method breaks the text into a list of words using the space character.
Complete the code to split the text into sentences using the period character.
sentences = text[1](".")
The split method divides the text into sentences by the period character.
Fix the error in the code to split text by commas.
parts = text[1](",")
To split text by commas, use the split method with "," as the separator.
Fill both blanks to create a dictionary with words as keys and their lengths as values, only for words longer than 3 letters.
lengths = {word[1] for word in words if len(word) [2] 3}The dictionary comprehension uses word: len(word) to map words to their lengths, and filters words with length greater than 3 using >.
Fill all three blanks to create a dictionary with uppercase words as keys, their counts as values, only for words appearing more than once.
result = [1]: [2] for [3], count in word_counts.items() if count > 1}
The dictionary comprehension uses word.upper() as keys, count as values, and iterates over word, count pairs.