Complete the code to get the length of each string in the 'Name' column.
df['Name_length'] = df['Name'].str.[1]()
The str.len() function returns the length of each string in the Series.
Complete the code to filter rows where the 'City' name length is greater than 5.
filtered = df[df['City'].str.len() [1] 5]
The condition str.len() > 5 selects rows where the city name has more than 5 characters.
Fix the error in the code to correctly calculate string lengths in the 'Country' column.
lengths = df['Country'].str.[1]()
The str.len() method is used with parentheses to get a Series of lengths.
Fill both blanks to create a dictionary of word lengths for words longer than 4 characters.
lengths = {word: word[1] for word in words if len(word) [2] 4}Use word.__len__() to get the length of each word, and filter words with length greater than 4 using >.
Fill all three blanks to create a dictionary with uppercase words as keys and their lengths as values for words shorter than 6 characters.
result = { [1]: [2] for word in words if len(word) [3] 6}The dictionary keys are uppercase words (word.upper()), values are their lengths (len(word)), and the filter selects words shorter than 6 (<).