Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the unit conversion module from scipy.
SciPy
from scipy import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated modules like integrate or optimize.
Trying to import a non-existent module for unit conversions.
✗ Incorrect
The constants module in scipy contains unit conversion utilities.
2fill in blank
mediumComplete the code to convert 10 inches to meters using scipy.constants.
SciPy
meters = 10 * constants.[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using foot or yard constants instead of inch.
Multiplying by the wrong unit constant.
✗ Incorrect
The inch constant converts inches to meters.
3fill in blank
hardFix the error in the code to convert 5 miles to meters.
SciPy
meters = 5 * constants.[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural form
miles which does not exist.Trying to use non-existent constants like
mile_to_meter.✗ Incorrect
The correct constant name is mile (singular) in scipy.constants.
4fill in blank
hardFill both blanks to convert 100 centimeters to meters and print the result.
SciPy
value_in_meters = 100 * constants.[1] print(value_in_meters, [2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural
centimeters which is not a constant.Printing the wrong unit string.
✗ Incorrect
The constant for centimeters is centimeter and the unit symbol 'm' is printed.
5fill in blank
hardFill all three blanks to create a dictionary converting lengths in feet to meters for values 1 to 3.
SciPy
lengths_in_meters = [1]: [2] * constants.[3] for [1] in range(1, 4)}
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variable names.
Using wrong constant names like
ft which does not exist.✗ Incorrect
Use length as the key and value variable, and foot constant to convert feet to meters.