
Answer-first summary for fast verification
Answer: The magic command `%python` will be inserted at the start of all Python code cells.
A magic command must be the first line in a cell. When changing the notebook's default language from Python to SQL, the magic command `%python` is automatically added at the beginning of all cells containing Python code. This ensures that the default language change does not disrupt the notebook's functionality. Databricks notebooks support several language magic commands, including `%python`, `%scala`, `%r`, and `%sql`. Therefore, the correct answer is that the magic command `%python` will be added at the beginning of all Python code cells.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In a Databricks notebook, all cells initially contain Python code. You decide to add a new cell with a SQL statement and change the notebook's default language to SQL for this purpose. What impact does this change have on the existing Python cells?
A
The magic command %python will be appended to the end of all Python code cells.
B
Python cells will become inactive (grayed out) and will not execute until the default language is switched back to Python.
C
The magic command %python will be inserted at the start of all Python code cells.
D
The magic command %sql will be added at the beginning of all Python code cells.
E
No changes will occur in any cell, and the notebook will function as before.