Challenge - 5 Problems
Jupyter Notebook Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
Output of cell execution order in Jupyter Notebook
Consider this sequence of Jupyter Notebook cells executed in order. What is the output of the last cell?
Data Analysis Python
a = 5 b = 10 # Cell 1 c = a + b # Cell 2 c = c * 2 # Cell 3 print(c)
Attempts:
2 left
💡 Hint
Remember that variables keep their values across cells unless redefined.
✗ Incorrect
The first cell defines c as 5 + 10 = 15. The second cell doubles c to 30. The third cell prints 30.
🧠 Conceptual
intermediate1:00remaining
Best practice for notebook cell length
Which of the following is the best practice regarding the length of cells in a Jupyter Notebook?
Attempts:
2 left
💡 Hint
Think about readability and debugging ease.
✗ Incorrect
Short cells focused on one task improve readability and make debugging easier.
🔧 Debug
advanced1:30remaining
Identify the error in this notebook cell
What error will this Jupyter Notebook cell produce when run?
Data Analysis Python
import pandas as pd df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]}) print(df['C'])
Attempts:
2 left
💡 Hint
Check if the column 'C' exists in the DataFrame.
✗ Incorrect
Accessing a non-existent column 'C' in a DataFrame raises a KeyError.
🚀 Application
advanced1:30remaining
Improving notebook reproducibility
Which practice below best improves reproducibility of a Jupyter Notebook?
Attempts:
2 left
💡 Hint
Think about what someone else needs to run your notebook and get the same results.
✗ Incorrect
Including all data loading and preprocessing ensures the notebook can be run from start to finish with consistent results.
❓ visualization
expert2:00remaining
Effect of inline plotting in Jupyter Notebook
What is the effect of running `%matplotlib inline` in a Jupyter Notebook?
Attempts:
2 left
💡 Hint
Consider how plots appear inside the notebook interface.
✗ Incorrect
The `%matplotlib inline` magic command makes plots appear inside the notebook below the code cells as static images.