Complete the code to find the maximum number in the list.
numbers = [3, 7, 1, 9, 4] max_value = [1](numbers) print(max_value)
The max() function returns the largest item in an iterable like a list.
Complete the code to find the minimum number in the list.
values = [10, 5, 8, 2, 7] min_value = [1](values) print(min_value)
The min() function returns the smallest item in an iterable.
Fix the error in the code to correctly find the maximum value.
data = [4, 9, 2, 6] max_value = max[1]data print(max_value)
The max() function requires parentheses around its argument.
Fill both blanks to create a dictionary with word lengths only for words longer than 3 letters.
words = ['cat', 'elephant', 'dog', 'lion'] lengths = {word: [1] for word in words if len(word) [2] 3} print(lengths)
The dictionary comprehension uses len(word) to get length and filters words with length greater than 3 using >.
Fill all three blanks to create a dictionary with uppercase keys and values only for values greater than 0.
data = {'a': 1, 'b': 0, 'c': 3}
result = [1]: [2] for k, v in data.items() if v [3] 0
print(result)The dictionary comprehension uses k.upper() for uppercase keys, v for values, and filters values greater than 0 with >.