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 Questions

Exam Name: WGU Foundations of Programming (Python) - E010 JIV1 Exam
Exam Code: Foundations-of-Programming-Python
Related Certification(s): WGU Courses and Certifications
Certification Provider: WGU
Number of Foundations-of-Programming-Python practice questions in our database: 60 (updated: May. 05, 2026)
Expected Foundations-of-Programming-Python Exam Topics, as suggested by WGU :
  • Topic 1: Data Types and Variables: Covers the basics of Python data types, variable creation, and how values are stored and manipulated in a program.
  • Topic 2: Control Structures and Logic: Focuses on decision-making using conditions and loops to control the flow of a program.
  • Topic 3: Functions and Modularity: Explains how to create and use functions to organize code into reusable and manageable parts.
  • Topic 4: Data Structures and Collections: Introduces lists, tuples, dictionaries, and sets, and how to store, access, and modify grouped data.
  • Topic 5: Input, Output, and Error Handling: Covers taking user input, displaying output, and handling errors to make programs more reliable.
Disscuss WGU Foundations-of-Programming-Python Topics, Questions or Ask Anything Related
0/2000 characters

Currently there are no comments in this discussion, be the first to comment!

Currently there are no comments in this discussion, be the first to comment!

Free WGU Foundations-of-Programming-Python Exam Actual Questions

Note: Premium Questions for Foundations-of-Programming-Python were last updated On May. 05, 2026 (see below)

Question #1

A program needs to update all values in a list by adding 5 to each number. Which for loop structure accomplishes this task?

Reveal Solution Hide Solution
Correct Answer: B

To update the actual values inside a list, the program must update each value by itsindex.

The correct code is:

for i in range(len(numbers)):

numbers[i] = numbers[i] + 5

Here, range(len(numbers)) produces valid index positions for the list. The variable i is used to access and update each list element.

Example:

numbers = [10, 20, 30]

for i in range(len(numbers)):

numbers[i] = numbers[i] + 5

print(numbers)

Output:

[15, 25, 35]

Option A does not correctly update the original list:

for number in numbers:

number = number + 5

This changes only the temporary loop variable number, not the actual elements stored inside the list.

Therefore, the correct answer isB.


Question #2

Which symbol begins a single-line comment in Python?

Reveal Solution Hide Solution
Correct Answer: B

In Python, a single-line comment begins with the # symbol.

Example:

# This is a comment

print('Hello')

Python ignores the comment when the program runs. The Python documentation identifies # as the symbol used for comments.

Therefore, the correct answer isB. # pound symbol.


Question #3

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

Reveal Solution Hide Solution
Correct 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.


Question #4

In Python, what must follow the in keyword in a for loop?

Reveal Solution Hide Solution
Correct Answer: B

In a Python for loop, the in keyword is followed by an iterable object, such as a list, string, tuple, dictionary, set, or range() object.

Example:

for name in ['Alice', 'Bob', 'Carol']:

print(name)

Here, ['Alice', 'Bob', 'Carol'] is the iterable object. Python's documentation explains that a for statement iterates over the items of a sequence or other iterable object.

Therefore, the correct answer isB. An iterable object.


Question #5

A program uses this while loop to count down:

count = 5

while count > 0:

print(count)

Which issue is preventing the loop from working correctly?

Reveal Solution Hide Solution
Correct Answer: B

The loop condition is:

while count > 0:

At the start, count is 5, so the condition is true. The program prints the value of count.

However, inside the loop, the value of count is never changed. That means count always stays 5, so the condition count > 0 is always true. As a result, the loop runs forever.

A corrected version would be:

count = 5

while count > 0:

print(count)

count = count - 1

This decreases count by 1 during each loop iteration. Eventually, count becomes 0, and the condition count > 0 becomes false.

Therefore, the correct answer isB. It runs infinitely because count is never modified.



Unlock Premium Foundations-of-Programming-Python Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now

Save Cancel