CompTIA Data+ (DA0-002) free question 2 / 10 · Domain 1: Data concepts and environments
An analyst is building a notebook that mixes explanation and analysis. She wants a section with a heading, a short description of the method, and a bulleted list of assumptions placed between two blocks of code. Which cell type is intended for that text?
- A code cell that is sent to the kernel when it is run in the notebook
- A Markdown cell, in which text is written in the Markdown language
- An output cell, which stores the results of running code in the notebook
- A raw cell, which holds content that the notebook does not render
Show the answer and explanation
Answer: B
Why this is correct
The Jupyter Notebook documentation says a notebook consists of a sequence of cells and that there are three types: code cells, Markdown cells, and raw cells. It describes Markdown cells as the way to document the computational process in a literate way, alternating descriptive text with code. Markdown headings use one to six hash signs followed by a space and a title, and they become clickable links to sections.
Why the other options are wrong
"A code cell that is sent to the kernel when it is run in the notebook" … A code cell holds code that runs on the kernel. Text written in one would be treated as code, and the output would be an error.
"A raw cell, which holds content that the notebook does not render" … Raw cells are one of three cell types, but they do not render Markdown into headings and lists, so the formatting would not appear.
"An output cell, which stores the results of running code in the notebook" … Output is attached to the code cell that produced it. The notebook structure has code, Markdown, and raw cells, and output is not a cell type of its own.
Key points
Explanations, headings, and lists go in Markdown cells. Code goes in code cells, and the results appear under the code cell that produced them.
Go to the CompTIA Data+ (DA0-002) practice app (10 free questions; purchase unlocks all questions)