Which command could you use to execute the python script named “sample.py”?
- python sample.py
- run sample.py
- python execute sample.py
- execute python sample.py
Explanation: Python scripts are written in text editors and saved locally using the .py file extension. To execute a script from a terminal or command-line interface, the standard method is to invoke the python statement followed by the filename. For example, the sources note that a script named cisco.py is normally run with the command python cisco.py, and a script named welcome.py is executed using python welcome.py. Consequently, to execute a script named sample.py, you would use the command python sample.py.
Related exam: Modules 21 – 22: Checkpoint Exam: Programmability Answers (CCNP ENCOR v9)
