Challenge - 5 Problems
Physical Constants Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output 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
intermediate1:30remaining
Number 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
advanced1:30remaining
Why 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
advanced1:30remaining
Identify 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
expert2:30remaining
Calculate 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.