Complete the code to import the GMRES solver from scipy.
from scipy.sparse.linalg import [1]
The GMRES solver is imported from scipy.sparse.linalg as gmres.
Complete the code to solve a linear system using the CG solver.
x, info = [1](A, b)The CG solver is called by cg(A, b) to solve the system Ax = b.
Fix the error in the code to correctly call GMRES with a restart parameter of 50.
x, info = gmres(A, b, restart=[1])The restart parameter must be an integer, so use 50 without quotes.
Fill both blanks to create a dictionary comprehension that maps each word to its length if the length is greater than 3.
{word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word) and filters words with length greater than 3 using len(word) > 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values where values are greater than zero.
result = [1]: [2] for [3], [2] in data.items() if [2] > 0}
The comprehension uses k.upper() as keys, v as values, and iterates over k, v in data.items(). It filters values greater than zero.