Complete the code to find the length of the list.
numbers = [1, 2, 3, 4, 5] length = [1](numbers) print(length)
The len() function returns the number of items in a list.
Complete the code to iterate over each character in the string.
word = "hello" for [1] in word: print(letter)
The variable letter is used to represent each character in the string during iteration.
Fix the error in the code to correctly count the number of times 'a' appears in the list.
letters = ['a', 'b', 'a', 'c', 'a'] count_a = letters.[1]('a') print(count_a)
The count() method counts how many times a value appears in a list.
Fill both blanks to create a dictionary with words as keys and their lengths as values, only for words longer than 3 letters.
words = ['apple', 'bat', 'carrot', 'dog'] lengths = {word: [1] for word in words if [2] > 3}
The dictionary comprehension uses len(word) to get the length and filters words with length greater than 3.
Fill all three blanks to create a dictionary with uppercase words as keys, their original words as values, only for words longer than 3 letters.
words = ['apple', 'bat', 'carrot', 'dog'] result = { [1]: [2] for word in words if len(word) [3] 3}
The dictionary comprehension uses word.upper() as keys, original word as values, and filters words with length greater than 3.