Complete the code to import the SciPy library.
import [1]
We import scipy to use its scientific computing tools.
Complete the code to use SciPy's integration function.
from scipy import [1]
The integrate module in SciPy helps calculate integrals.
Fix the error in the code to calculate the integral of sin(x) from 0 to pi.
import numpy as np from scipy import integrate result, error = integrate.quad(np.[1], 0, np.pi) print(result)
The function to integrate is sin, so we use np.sin.
Fill both blanks to create a dictionary comprehension that maps words to their lengths if length is greater than 3.
words = ['data', 'science', 'is', 'fun'] lengths = {word: [1] for word in words if [2]
We map each word to its length using len(word) and filter words with length greater than 3.
Fill both blanks to create a dictionary comprehension that maps uppercase words to their lengths if length is greater than 2.
words = ['AI', 'ML', 'DATA', 'SCIENCE'] result = {word.[1](): [2] for word in words if len(word) > 2}
The dictionary starts with {, words are converted to uppercase with upper(), and values are word lengths.