Complete the code to import the popular library for numerical computing in Python.
import [1] as np
numpy is the main library for numerical computing in Python. It provides arrays and math functions.
Complete the code to load a dataset from scikit-learn.
from sklearn.datasets import [1] data = [1]()
The load_iris function loads the Iris flower dataset, a classic ML dataset.
Fix the error in the code to create a simple linear regression model.
from sklearn.linear_model import [1] model = [1]()
LinearRegression is the correct class to create a linear regression model.
Fill both blanks to create a dictionary comprehension that maps words to their lengths if length is greater than 3.
{word: [1] for word in words if [2]The dictionary maps each word to its length using len(word). The condition keeps words longer than 3 characters with len(word) > 3.
Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than zero.
result = { [1]: [2] for k, v in data.items() if v [3] 0 }The dictionary comprehension uses k.upper() for keys, v for values, and filters values greater than zero with >.
