Complete the code to add the number 5 to the list.
numbers = [1, 2, 3] numbers.[1](5) print(numbers)
The append method adds an element to the end of the list.
Complete the code to remove the element 3 from the list.
numbers = [1, 2, 3, 4] numbers.[1](3) print(numbers)
The remove method deletes the first occurrence of the specified value from the list.
Fix the error in the code to remove the last element from the list.
items = ['a', 'b', 'c'] items.[1]() print(items)
The pop() method removes and returns the last item in the list when called without arguments.
Fill both blanks to create a list of squares for numbers greater than 3.
squares = [x[1]2 for x in range(1, 6) if x [2] 3] print(squares)
The ** operator is used for exponentiation (power), and > checks if a number is greater than another.
Fill all three blanks to create a dictionary with uppercase keys and values greater than 0.
result = [1]: [2] for [3], v in data.items() if v > 0} print(result)
We use k.upper() to make keys uppercase, v for values, and k to unpack keys from the dictionary.