
Answer-first summary for fast verification
Answer: By adding the comment `# Databricks notebook source` on the first line of the file's source code
To convert Python, SQL, Scala, and R scripts into single-cell notebooks, simply add the comment `# Databricks notebook source` to the first cell of the file. This method is documented in the Databricks official documentation for notebook export and import operations.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you designate a Python file as a notebook in Databricks?
A
By including the magic command %databricks at the beginning of the file's source code
B
By importing the dbutils.notebook module within the file's source code
C
By initiating a Spark session with SparkSession.builder.getOrCreate() in the file's source code
D
By adding the comment # Databricks notebook source on the first line of the file's source code
E
None of the above is accurate. Notebooks are binary files with a .pydb extension
No comments yet.