0
0
SciPydata~10 mins

Unit conversion utilities in SciPy - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Aintegrate
Boptimize
Cconstants
Dstats
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated modules like integrate or optimize.
Trying to import a non-existent module for unit conversions.
2fill in blank
medium

Complete 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'
Amile
Bfoot
Cyard
Dinch
Attempts:
3 left
💡 Hint
Common Mistakes
Using foot or yard constants instead of inch.
Multiplying by the wrong unit constant.
3fill in blank
hard

Fix 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'
Amile
Bmiles
Cmile_to_meter
Dmile_in_meters
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural form miles which does not exist.
Trying to use non-existent constants like mile_to_meter.
4fill in blank
hard

Fill 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'
Acentimeter
B'meters'
C'm'
Dcentimeters
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural centimeters which is not a constant.
Printing the wrong unit string.
5fill in blank
hard

Fill 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'
Aft
Bvalue
Cfoot
Dlength
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variable names.
Using wrong constant names like ft which does not exist.