Complete the code to use a built-in function that finds the length of a 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 convert a string to uppercase using a built-in function.
word = "hello" upper_word = word.[1]() print(upper_word)
The upper() method converts all letters in a string to uppercase.
Fix the error by completing the code to find the maximum number in a list using a built-in function.
values = [10, 20, 30, 40] max_value = [1](values) print(max_value)
The built-in function max() returns the largest item in a list.
Fill both blanks to create a dictionary with word lengths only for words longer than 3 letters.
words = ['cat', 'elephant', 'dog', 'giraffe'] lengths = {word: [1] for word in words if len(word) [2] 3} print(lengths)
Use len(word) to get the length and > to filter words longer than 3 letters.
Fill all three blanks to create a dictionary with uppercase words as keys and their lengths as values for words longer than 4 letters.
words = ['apple', 'bat', 'carrot', 'dog'] result = { [1]: [2] for w in words if len(w) [3] 4 } print(result)
Use w.upper() for keys, len(w) for values, and > to filter words longer than 4 letters.