A packing application can successfully import a local file named supplies.py, which contains only this assignment:
BOX_SIZE = 24
No module named missing_supplies is available. Each snippet below runs separately in a fresh Python interpreter. Enter the exception class raised by each snippet: ModuleNotFoundError, ImportError, or AttributeError.
Snippet A
import missing_supplies
Snippet B
from supplies import CASE_SIZE
Snippet C
import supplies print(supplies.CASE_SIZE)
Unlock full course notes by signing up
Track the names an import introduces
Each Python statement below runs separately in a fresh session. Enter the single name that the statement makes directly available for later use. Enter only the name, without parentheses or a dotted expression.
Calculate with two import forms
An art supplier can divide 37.5 kg of clay among cartons, each holding at most 8.0 kg. The following Python code calculates packing quantities. Here floor rounds down to an integer and ceil rounds up to an integer.
Find full, the number of completely filled cartons, and cartons, the total number needed, as exact integers. Find unused, the total unused capacity in kg, to one decimal place. Ignore carton mass and packing losses.
Separate an imported value from a module attribute
A project contains a Python module named local_rates.py whose entire contents are shown below:
In a fresh session, a booking program then runs this code successfully:
Which statements are true immediately afterward? Select every true statement. Assume no other imports or assignments occur.
Change the search path after importing
A school shop has two different files named pricing.py. Their complete contents are shown below.
File /class/shop/pricing.py
File /class/shared/pricing.py