WGU Foundations-of-Programming-Python Practice Exam Questions & Answers

7 Free Questions Last reviewed October 29, 2026 Prepared & Reviewed by the ValidExamDumps Editorial Team

60 Practice Questions (Our Bank)
Exam Facts

WGU Foundations-of-Programming-Python Exam Details

Key details for this exam, checked against the published exam outline

Exam Code
Foundations-of-Programming-Python
Full Name
Foundations of Programming (Python) - E010 JIV1
Issuing Body
WGU Courses and Certifications
Question Format (Our Bank)
Multiple Choice
Practice Questions

Free Foundations-of-Programming-Python Practice Questions

Each question shows the correct answer and an explanation of why it is right

VA
ValidExamDumps Editorial Team Every question and its answer is checked by our Foundations-of-Programming-Python exam preparation team, who also write the explanation shown with each one. How we research and review these pages

Question 1 Domain 5 Data Structures and Input/Output

Which terminal command is used to navigate to a different directory before running a Python script?

Correct Answer C
Explanation

The command cd means ''change directory.'' It is used in a terminal to move from one folder to another.

Example:

cd Desktop

After navigating to the correct folder, a Python script can be run with a command such as:

python script.py

Therefore, the correct answer isC. cd.

Question 2 Domain 3 Loops and Iteration

Which punctuation mark must appear at the end of an if statement line?

Correct Answer B
Explanation

In Python, an if statement line must end with a colon.

Example:

age = 18

if age >= 18:

print('Adult')

The colon : tells Python that an indented block of code follows. That indented block contains the statements that should run when the condition is true.

A semicolon, period, or comma is not used to begin the body of an if statement in Python.

Therefore, the correct answer is B. : colon.

Question 3 Domain 3 Loops and Iteration

Which index position is returned when the string method .find('python') is applied to the string 'learning python programming'?

Correct Answer B
Explanation

The .find() method returns the lowest index where the searched substring is found.

Example:

'learning python programming'.find('python')

Output:

9

Indexing starts at 0 in Python. In the string 'learning python programming', the word 'python' begins at index 9. Python's built-in types documentation describes str.find() as returning the lowest index where the substring is found.

Therefore, the correct answer isB. 9.

Get the complete Foundations-of-Programming-Python question set $20$40

Get Full Access

Question 4 Domain 4 Functions and Modular Programming

Complete the function update_grade(grades, student, new_grade) that takes a grades dictionary, a student name, and a new grade, then updates that student's grade and returns the dictionary.

For example, update_grade({"Alice": 85, "Bob": 90}, "Alice", 95) should return {"Alice": 95, "Bob": 90}.

Correct Answer A
Explanation

A dictionary stores data as key-value pairs. In this function, the student name is the key, and the grade is the value.

Correct code:

def update_grade(grades, student, new_grade):

grades[student] = new_grade

return grades

Example:

update_grade({'Alice': 85, 'Bob': 90}, 'Alice', 95)

Result:

{'Alice': 95, 'Bob': 90}

Python's built-in types documentation includes dictionaries as mapping types, where values are accessed and updated using keys.

Therefore, the correct answer isA.

Question 5 Domain 5 Data Structures and Input/Output

SIMULATION

Modify the function greet_with_default(name) by adding a default value of "World" to the name parameter so it can be called with or without an argument.

def greet_with_default(name):

# TODO: Add a default value of "World" to the name parameter

return "Hello " + name

Correct Answer A
Explanation

Step 1: A default parameter value allows a function to be called even when no argument is provided.

Step 2: The default value should be added in the function header.

Step 3: The parameter name should have the default value 'World'.

Correct code:

def greet_with_default(name='World'):

return 'Hello ' + name

Example:

print(greet_with_default())

print(greet_with_default('Alice'))

Output:

Hello World

Hello Alice

Question 6 Domain 4 Functions and Modular Programming

SIMULATION

Write a complete function calculate_average(grades) that takes a list of grades and returns the average as a float.

For example, calculate_average([85, 92, 78]) should return 85.0.

def calculate_average(grades):

# TODO: Calculate and return the average grade as a float

pass

Correct Answer A
Explanation

Step 1: The function receives one parameter named grades, which is a list of numbers.

Step 2: Use sum(grades) to add all the grades together.

Step 3: Use len(grades) to count how many grades are in the list.

Step 4: Divide the total by the number of grades.

Correct code:

def calculate_average(grades):

return sum(grades) / len(grades)

Example:

print(calculate_average([85, 92, 78]))

Output:

85.0

Question 7 Domain 5 Data Structures and Input/Output

Which keyword is used to exit a loop prematurely in Python?

Correct Answer B
Explanation

The break keyword exits a loop immediately before the loop condition naturally becomes false or before all items have been processed.

Example:

for number in range(10):

if number == 5:

break

print(number)

When number becomes 5, the loop stops. Python's control-flow documentation explains the use of break in loops.

Therefore, the correct answer isB. break.

Study Guide

What the WGU Foundations-of-Programming-Python Exam Covers

5 domains from the WGU Foundations-of-Programming-Python exam outline, with approximate weightings. Every sample question above is tagged with the domain it comes from

Domain 1 Variables, Data Types, and Basic Operations

Declare and initialize variables, assign values, and perform arithmetic and string operations. Recognize data type behavior including integers, floats, strings, and booleans, and apply type conversion where needed.

Domain 2 Control Flow and Decision Making

Use if, elif, and else statements to direct program flow based on conditions. Apply logical operators (and, or, not) and write conditional expressions to handle different scenarios.

Domain 3 Loops and Iteration

Use for and while loops to repeat code blocks and iterate through sequences like lists and strings. Control loop behavior with break and continue statements.

Sample questions from this domain above Q2Q3

Domain 4 Functions and Modular Programming

Define and call functions with parameters and return values. Understand variable scope and how to write reusable code modules that follow the DRY principle.

Sample questions from this domain above Q4Q6

Domain 5 Data Structures and Input/Output

Work with lists, tuples, and dictionaries to organize and store data. Perform user input and output operations, handle basic file operations, and process data.

Sample questions from this domain above Q1Q5Q7

FAQ

Foundations-of-Programming-Python Exam FAQ

Common questions about the exam itself

What programming experience do I need before taking Foundations of Programming (Python) E010 JIV1?
This exam is designed as a foundational certification and assumes no prior programming experience. You should have basic computer literacy and be comfortable using a text editor and command line, but formal coding knowledge is not required.
How long should I study for the Foundations of Programming Python E010 JIV1 exam?
Most candidates spend 4 to 8 weeks preparing, depending on their background and available study time. If you have no programming experience, plan toward the longer end. The five content areas build on each other, so spacing practice over several weeks helps reinforce concepts.
What topics do most candidates find hardest on the E010 JIV1 exam?
Control flow and nested loops tend to challenge candidates most. Practice writing and tracing code that uses if statements inside loops, and work through scenarios where you need to combine conditions with iteration to understand the interaction between these concepts.
Is the Foundations of Programming Python E010 JIV1 exam proctored, and can I take it online?
WGU certification exams are typically proctored, though you should confirm the exact delivery method and testing location options on the official WGU exam page when you register.
What score do I need to pass Foundations of Programming (Python) E010 JIV1?
WGU publishes passing scores for each exam, but the specific threshold for E010 JIV1 is not confirmed in available sources. Check the official exam registration page for the exact passing score.
Can I retake the Foundations of Programming Python E010 JIV1 exam if I don't pass?
Yes, WGU allows exam retakes. Specific policies on retake scheduling and any waiting periods between attempts should be confirmed in your WGU student handbook or through your program advisor.
How long is the Foundations of Programming (Python) E010 JIV1 certification valid after I pass?
The validity period for WGU certifications varies by program. Check your program documentation or contact WGU to confirm whether E010 JIV1 expires after a set number of years or remains valid indefinitely.
What job roles does the Foundations of Programming Python E010 JIV1 certification support?
This exam validates foundational Python skills that prepare you for entry-level programming roles such as junior developer, software developer, or junior data analyst. It also serves as a stepping stone to more advanced WGU programming certifications.
How does E010 JIV1 relate to other programming certifications in the WGU track?
Foundations of Programming (Python) E010 JIV1 is a beginner-level certification within the WGU Courses and Certifications pathway. It establishes core Python knowledge before advancing to intermediate or specialized programming certifications.
What format are the questions on the Foundations of Programming Python E010 JIV1 exam?
The exam uses multiple-choice, scenario-based, and code-reading questions that test your ability to write, debug, and reason about Python code. Expect questions where you read code and predict output, write code snippets, or identify errors in existing code.

Other WGU Exams

Free practice questions for more WGU certification exams

All WGU exams