Designing and Implementing a Data Science Solution on Azure — Question 186

You have a Jupyter Notebook that contains Python code that is used to train a model.
You must create a Python script for the production deployment. The solution must minimize code maintenance.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

Answer options

Correct answer: A, C

Explanation

Option A is correct because refactoring the code into functions enhances modularity, making it easier to maintain. Option C is also correct as defining a main() function provides a clear entry point for the script, which is a best practice in Python. Options B and D are incorrect; while separating functions into different files can help with organization, it does not directly contribute to minimizing maintenance in this context, and removing comments and functions would hinder understanding and functionality.