0
0
SciPydata~10 mins

Physical constants (speed of light, Planck) 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 speed of light constant from scipy.constants.

SciPy
from scipy.constants import [1]
print(speed_of_light)
Drag options to blanks, or click blank then click option'
Ac
Bplanck
Ch
Dspeed_of_light
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'c' instead of 'speed_of_light' causes a NameError.
Confusing Planck constant names with speed of light.
2fill in blank
medium

Complete the code to print the value of Planck's constant from scipy.constants.

SciPy
from scipy.constants import [1]
print(planck)
Drag options to blanks, or click blank then click option'
Aspeed_of_light
Bhbar
Cplanck
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hbar' instead of 'planck' imports the reduced Planck constant.
Using 'c' or 'speed_of_light' imports the wrong constant.
3fill in blank
hard

Fix the error in the code to correctly import and print the reduced Planck constant.

SciPy
from scipy.constants import [1]
print(hbar)
Drag options to blanks, or click blank then click option'
Ahbar
Bspeed_of_light
Cc
Dplanck
Attempts:
3 left
💡 Hint
Common Mistakes
Importing 'planck' instead of 'hbar' causes a NameError.
Using 'speed_of_light' or 'c' imports unrelated constants.
4fill in blank
hard

Fill both blanks to create a dictionary with keys 'c' and 'h' for speed of light and Planck constant values.

SciPy
from scipy.constants import speed_of_light, planck
constants = {'c': [1], 'h': [2]
print(constants)
Drag options to blanks, or click blank then click option'
Aspeed_of_light
Bplanck
Chbar
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'c' or 'h' as values instead of the imported constants.
Mixing up speed_of_light and planck in the dictionary.
5fill in blank
hard

Fill all three blanks to create a dictionary with keys 'c', 'h', and 'hbar' for speed of light, Planck constant, and reduced Planck constant.

SciPy
from scipy.constants import speed_of_light, planck, hbar
constants = {'c': [1], 'h': [2], 'hbar': [3]
print(constants)
Drag options to blanks, or click blank then click option'
Aplanck
Bspeed_of_light
Chbar
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the values for 'c' and 'h'.
Using string keys as values instead of constants.