Complete the code to import the module that helps with math operations.
import [1]
The math module provides functions for mathematical operations, so importing it allows you to use those functions easily.
Complete the code to use the randint function from the random module.
from random import [1] number = randint(1, 10)
The randint function generates a random integer between two numbers. Importing it directly lets you use it without the module prefix.
Fix the error in the code by completing the import statement correctly.
import [1] print(os.name)
name attribute.The os module provides the name attribute used here. Importing os fixes the error.
Fill both blanks to create a list of squares using the range function and a standard library feature.
squares = [x[1]2 for x in [2](1, 6)]
range.The ** operator is used for exponentiation (power), and range generates numbers from 1 to 5. Together, they create squares of numbers.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: {BLANK_2}} for [2] in words if len({{BLANK_3}}) > 3The dictionary comprehension starts with {, uses the word as the key, and its length as the value. The variable word is used to iterate over words.