Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Free Exam Questions

Foundations-of-Programming-Python Exam Questions & Answers

Foundations of Programming (Python) - E010 JIV1  •  WGU

60 Questions Updated Sep 2026 99% Pass Rate
Get Full Access

100% money-back guarantee

Sample Foundations-of-Programming-Python Questions

Practice with real exam-style questions, each with the verified correct answer and explanation.

Q1 MultipleChoice

Which type of loop repeatedly checks a condition to determine whether to continue?

Correct Answer: B
Explanation:

Awhile looprepeatedly executes a block of code as long as its condition remains true.

Example:

count = 1

while count <= 3:

print(count)

count += 1

In this example, Python checks the condition count <= 3 before each loop iteration. If the condition is true, the loop continues. When the condition becomes false, the loop stops.

A for loop is usually used to iterate over a sequence, such as a list, string, or range. Python does not have a built-in repeat loop construct.

Therefore, the correct answer isB. while loop.

Q2 MultipleChoice

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

Q3 MultipleChoice

SIMULATION

Fix the off-by-one error in this function that should return the first 3 characters of a string.

def first_three(text):

return text[0:2]

Correct Answer: A
Explanation:

Step 1: Python string slicing uses this format:

text[start:stop]

Step 2: The start index is included.

Step 3: The stop index is excluded.

Step 4: To return the first 3 characters, start at index 0 and stop at index 3.

Correct code:

def first_three(text):

return text[0:3]

Simplified correct code:

def first_three(text):

return text[:3]

Example:

print(first_three('Python'))

Output:

Pyt

Q4 MultipleChoice

In the code for item in my_list:, what does item represent?

Correct Answer: B
Explanation:

In the loop:

for item in my_list:

print(item)

item represents the current element from my_list during each loop iteration.

For example:

my_list = ['apple', 'banana']

for item in my_list:

print(item)

The loop first processes 'apple', then 'banana'. Python's documentation explains that a for statement iterates over the items of a sequence in order.

Therefore, the correct answer isB. The current element being processed.

Q5 MultipleChoice

How can the first four characters be extracted from the string 'computer'?

Correct Answer: A
Explanation:

Python strings are sequences, and sequence values can be accessed using indexing and slicing.

The first character in a Python string has index 0. To extract the first four characters from 'computer', the slice should start at index 0 and stop at index 4.

Example:

'computer'[0:4]

Result:

'comp'

In Python slicing, the start index is included, but the stop index is excluded. So [0:4] includes characters at indexes 0, 1, 2, and 3.

The official Python documentation explains that slicing with a[start:stop] selects items from the start index up to, but not including, the stop index.

Therefore, the correct answer is A. 'computer'[0:4].

Get access to all 60 verified questions with detailed answers.

Unlock All Foundations-of-Programming-Python Questions

Frequently Asked Questions

The exam covers fundamental programming concepts including variables, data types, control structures, functions, and basic object-oriented programming principles using Python. You'll also be tested on problem-solving skills, debugging, and understanding how to write clean, readable code that follows Python conventions.

The exam typically consists of multiple-choice and scenario-based questions designed to assess your understanding of Python fundamentals. The exact number of questions and time limit may vary, so it's recommended to check WGU's official exam guidelines for the most current information.

Focus on understanding basic syntax, working with strings and numbers, using loops and conditional statements, creating and calling functions, and understanding lists and dictionaries. Additionally, study exception handling, file I/O operations, and basic principles of object-oriented programming such as classes and objects.

Requirements vary by program, but this is typically an introductory course, so there may be minimal or no prerequisites. Check your specific WGU program requirements and course syllabus for any prerequisite coursework you need to complete before attempting the certification exam.

WGU provides course materials, video lectures, textbooks, and practice activities within the course learning management system. You may also have access to tutoring services, study guides, and practice exams to help you prepare for the certification assessment.
Exam Details
  • Exam CodeFoundations-of-Programming-Python
  • VendorWGU
  • Total Questions60
  • LanguageEnglish
  • Last UpdatedSep 5, 2026
4.9/5

Pass Foundations-of-Programming-Python First Time

Get all 60 exam questions with verified answers and 90-day free updates.

Buy Now & Pass
  • PDF + Practice Test Bundle
  • 90-Day Free Updates
  • 100% Money-Back Guarantee
  • Instant Download
  • 24/7 Customer Support
99% Pass Rate Trusted by 50,000+ IT professionals