Challenge - 5 Problems
Master of Mathematical Constants
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:00remaining
Output of pi constant from scipy
What is the output of this code snippet that prints the value of pi from scipy.constants?
SciPy
from scipy.constants import pi print(round(pi, 4))
Attempts:
2 left
💡 Hint
Use round() to 4 decimal places on pi constant.
✗ Incorrect
The scipy.constants.pi value is approximately 3.141592653589793. Rounded to 4 decimals, it becomes 3.1416.
❓ data_output
intermediate1:00remaining
Value of Euler's number (e) from numpy
What is the value of Euler's number (e) from numpy when rounded to 3 decimals?
SciPy
from numpy import e print(round(e, 3))
Attempts:
2 left
💡 Hint
Euler's number e is about 2.71828.
✗ Incorrect
The constant e from numpy is approximately 2.718281828459045. Rounded to 3 decimals, it is 2.718.
🧠 Conceptual
advanced1:30remaining
Understanding the golden ratio constant
Which of the following statements about the golden ratio constant from scipy.constants is true?
Attempts:
2 left
💡 Hint
Think about the unique properties of the golden ratio.
✗ Incorrect
The golden ratio is approximately 1.6180339887 and appears in nature, art, and architecture as a pleasing proportion.
❓ Predict Output
advanced1:30remaining
Calculate the sum of pi, e, and golden ratio constants
What is the output of this code that sums pi and golden from scipy.constants and e from numpy and rounds to 5 decimals?
SciPy
from scipy.constants import pi, golden from numpy import e result = pi + e + golden print(round(result, 5))
Attempts:
2 left
💡 Hint
Add the three constants and round the sum to 5 decimals.
✗ Incorrect
pi ≈ 3.141592653589793 (scipy.constants), e ≈ 2.718281828459045 (numpy), golden ≈ 1.618033988749895 (scipy.constants). Sum ≈ 7.477908470798733. Rounded to 5 decimals: 7.47791.
🔧 Debug
expert2:00remaining
Identify the error in accessing the golden ratio constant
What error will this code raise when trying to import and print the golden ratio constant from scipy.constants?
SciPy
from scipy.constants import golden_ratio print(golden_ratio)
Attempts:
2 left
💡 Hint
Check the exact name of the golden ratio constant in scipy.constants.
✗ Incorrect
The golden ratio constant in scipy.constants is named 'golden', not 'golden_ratio'. Trying to import 'golden_ratio' causes ImportError.