Complete the code to remove spaces from the start and end of the string.
cleaned = raw_string.[1]()The strip() method removes spaces from the start and end of a string.
Complete the code to convert the string to all lowercase letters.
cleaned = raw_string.[1]()The lower() method changes all letters in a string to lowercase.
Fix the error in the code to replace all commas with semicolons.
cleaned = raw_string.[1](',', ';')
The replace() method replaces all occurrences of the first string with the second string.
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 len(word) as values and filters words with length greater than 3 using >.
Fill all three blanks to create a dictionary with uppercase words as keys, original words as values, only for words containing 'a'.
result = [1]: [2] for word in words if '[3]' in word}
The keys are uppercase words using word.upper(), values are original words, and the filter checks if 'a' is in the word.