Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

WGU Foundations of Programming Python Exam - Topic 2 Question 8 Discussion

What sequence of steps is required to execute a Python script from a text editor using the terminal on a Windows device?
A) Save file > open terminal > type python filename.py
B) Save file > close text editor > open different IDE
C) Open terminal > write code directly > press Enter
D) Save file > compile code > run executable

WGU Foundations of Programming Python Exam - Topic 2 Question 8 Discussion

Actual exam question for WGU's Foundations of Programming Python exam
Question #: 8
Topic #: 2
[All Foundations of Programming Python Questions]

What sequence of steps is required to execute a Python script from a text editor using the terminal on a Windows device?

Show Suggested Answer Hide Answer
Suggested Answer: A

To run a Python script from a text editor using the terminal on Windows, the file should first be saved with the .py extension. Then, the terminal is opened, and the script is executed using the Python command followed by the filename.

Example:

python filename.py

The official Python documentation explains that when the interpreter is called with a filename argument, it reads and executes the script from that file. On Windows, the python command can be used from a terminal after Python is installed and configured correctly.

Therefore, the correct answer is A. Save file > open terminal > type python filename.py.


Contribute your Thoughts:

0/2000 characters
Arletta
9 hours ago
I’m a bit confused about the compiling part in option D; I thought Python scripts just run directly without needing to compile.
upvoted 0 times
...
Elly
6 days ago
I feel like option B is wrong because we shouldn't need to open a different IDE just to run a script.
upvoted 0 times
...
Huey
11 days ago
I remember practicing a similar question, and I think we definitely need to type "python filename.py" in the terminal after saving the file.
upvoted 0 times
...
Darell
16 days ago
I think the right steps start with saving the file, but I'm not sure if we need to open the terminal first or after that.
upvoted 0 times
...

Save Cancel