0
0
SciPydata~10 mins

scipy.constants module - 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 scipy.constants module.

SciPy
import [1]
Drag options to blanks, or click blank then click option'
Ascipy.constants_module
Bscipy.constant
Cscipy.constants
Dscipy.const
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular 'constant' instead of 'constants'.
Using incomplete or incorrect module names.
2fill in blank
medium

Complete the code to print the value of the speed of light constant.

SciPy
from scipy.constants import [1]
print([1])
Drag options to blanks, or click blank then click option'
Aspeedlight
Bc_light
Clight_speed
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect constant names like 'c_light' or 'light_speed'.
Trying to access constants without importing them.
3fill in blank
hard

Fix the error in the code to correctly get the Planck constant value.

SciPy
import scipy.constants
planck = scipy.constants.[1]
print(planck)
Drag options to blanks, or click blank then click option'
Ah
Bplanck_constant
CPlanck_constant
DPlanckConstant
Attempts:
3 left
💡 Hint
Common Mistakes
Using camel case or capitalized names.
Trying to use underscores incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary of constants for 'pi' and 'golden' ratio.

SciPy
from scipy.constants import [1], [2]
constants_dict = {'pi': [1], 'golden_ratio': [2]
print(constants_dict)
Drag options to blanks, or click blank then click option'
Api
Bgolden
Ce
Dtau
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'e' or 'tau' instead of 'golden' for the golden ratio.
Mixing up constant names.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension of constants with values greater than 1.

SciPy
import scipy.constants
large_constants = {k: v for k, v in scipy.constants.__dict__.items() if isinstance(v, (int, float)) and v [1] 1 and not k.startswith('_') and k != '[2]' and k != '[3]'}
print(large_constants)
Drag options to blanks, or click blank then click option'
A>
Bpi
Cgolden
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for the comparison.
Wrong constant names in exclusion.