Challenge - 5 Problems
Physical Constants Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
โ Predict Output
intermediateOutput of using physical constants in calculations
What is the output of this code that calculates the energy of a photon using Planck's constant and frequency?
SciPy
from scipy.constants import Planck frequency = 5e14 # frequency in Hz energy = Planck * frequency print(round(energy, 20))
Attempts:
2 left
๐ก Hint
Energy = Planck's constant * frequency
โ Incorrect
The energy of a photon is calculated by multiplying Planck's constant (about 6.626e-34 Js) by the frequency (5e14 Hz). The result is approximately 3.313e-19 Joules.
โ data_output
intermediateNumber of physical constants in scipy.constants
How many physical constants are available in scipy.constants module?
SciPy
import scipy.constants as sc constants_list = [attr for attr in dir(sc) if not attr.startswith('__') and isinstance(getattr(sc, attr), (int, float))] print(len(constants_list))
Attempts:
2 left
๐ก Hint
Count all numeric attributes in scipy.constants excluding private ones
โ Incorrect
The scipy.constants module contains about 70 physical constants as numeric attributes.
๐ง Conceptual
advancedWhy precision of physical constants matters in computation
Why is it important to use precise values of physical constants in scientific computations?
Attempts:
2 left
๐ก Hint
Think about error propagation in calculations
โ Incorrect
Small inaccuracies in physical constants can lead to significant errors in scientific results, especially in sensitive calculations.
๐ง Debug
advancedIdentify the error in using physical constants
What error will this code produce when trying to calculate the speed of light squared?
SciPy
from scipy.constants import speed_of_light c_squared = speed_of_light ** 2 print(c_squared) c_squared = speed_of_light * speed_of_light print(c_squared)
Attempts:
2 left
๐ก Hint
Check the type of speed_of_light and the operations used
โ Incorrect
speed_of_light is a float constant. Both exponentiation and multiplication work and produce the same result without error.
๐ Application
expertCalculate the wavelength of a photon given energy
Using scipy.constants, which option correctly calculates the wavelength (in meters) of a photon with energy 4e-19 Joules?
SciPy
from scipy.constants import Planck, speed_of_light energy = 4e-19 wavelength = Planck * speed_of_light / energy print(wavelength)
Attempts:
2 left
๐ก Hint
Wavelength = (Planck constant * speed of light) / energy
โ Incorrect
The wavelength is calculated by dividing Planck's constant times speed of light by the photon energy. This gives approximately 4.97e-07 meters.
