0
0
SciPydata~20 mins

scipy.constants module - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Scipy Constants Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:30remaining
Output of accessing a physical constant
What is the output of this code snippet using scipy.constants?
SciPy
from scipy.constants import speed_of_light
print(round(speed_of_light, 1))
A3.0e8
B299792458.0
C299792.458
D299792458
Attempts:
2 left
💡 Hint
The speed of light constant is given in meters per second as an integer value.
data_output
intermediate
1:30remaining
Number of constants in a dictionary
How many physical constants are included in the dictionary returned by scipy.constants.physical_constants?
SciPy
from scipy.constants import physical_constants
print(len(physical_constants))
A100
B90
C74
D84
Attempts:
2 left
💡 Hint
Count the keys in the dictionary of physical constants.
🧠 Conceptual
advanced
2:00remaining
Understanding units in scipy.constants
Which of the following statements about the units of constants in scipy.constants.physical_constants is correct?
AUnits are stored as separate variables outside the dictionary.
BAll constants are given only in SI base units without any unit names.
CConstants are stored as simple floats without unit information.
DEach constant is a tuple containing the value, unit string, and uncertainty.
Attempts:
2 left
💡 Hint
Check the structure of the values in the physical_constants dictionary.
🔧 Debug
advanced
1:30remaining
Error raised by incorrect import
What error will this code raise?
SciPy
from scipy.constants import speed_of_lightt
print(speed_of_lightt)
AImportError
BAttributeError
CModuleNotFoundError
DNameError
Attempts:
2 left
💡 Hint
Check the spelling of the imported constant.
🚀 Application
expert
2:00remaining
Calculate energy equivalent of 1 kg mass using scipy.constants
Using scipy.constants, which option correctly calculates the energy equivalent (in joules) of 1 kilogram mass using Einstein's equation E=mc²?
SciPy
from scipy.constants import speed_of_light
mass = 1  # in kilograms
energy = ???
print(energy)
Amass * speed_of_light ** 2
Bmass * (speed_of_light * 2)
Cmass * speed_of_light * speed_of_light
Dmass ** 2 * speed_of_light
Attempts:
2 left
💡 Hint
Remember the formula E = m times c squared.