Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: chrismas

Free Practice Questions for the WGU Courses and Certificates Foundations-of-Programming-Python Exam (2026 Updated)

At Marks4sure, we are dedicated to providing IT professionals with the most accurate and reliable preparation materials for the WGU Foundations-of-Programming-Python exam. To support your certification journey, we have made a selection of our premium 2026 Courses and Certificates practice questions and answers available completely free. You can take this practice test as many times as you need. Every question includes a detailed, expertly verified explanation to ensure you fully grasp the core security concepts before test day.

Questions 4

Which data type is the value 3.14 in Python?

Options:

A.

Integer

B.

Float

C.

String

D.

Boolean

Buy Now
Questions 5

What advantage does an integrated terminal provide compared to using a separate terminal application?

Options:

A.

Faster code execution speed

B.

Access to additional Python libraries

C.

Eliminates need to switch between applications

D.

Automatic syntax error detection

Buy Now
Questions 6

Which components are required in every Python while loop?

Options:

A.

A condition and an indented code block

B.

A variable and a return statement

C.

A counter and a break statement

D.

An iterator and a list

Buy Now
Questions 7

Which Python data structure allows duplicate values and supports methods like append() and remove()?

Options:

A.

Set

B.

Dictionary

C.

List

D.

Tuple

Buy Now
Questions 8

What must be consistent within a Python code block for the code to run without syntax errors?

Options:

A.

Variable names

B.

Indentation level

C.

Comment placement

D.

Line length

Buy Now
Questions 9

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

Options:

Buy Now
Questions 10

Complete the function get_max(a, b) that returns the larger of two numbers. If they are equal, return either one.

def get_max(a, b):

# TODO: Return the larger of a and b

pass

Options:

Buy Now
Questions 11

Which Python data structure automatically prevents duplicate values from being stored?

Options:

A.

List

B.

Tuple

C.

Dictionary

D.

Set

Buy Now
Questions 12

What must a developer do to run Python code written in a text editor?

Options:

A.

Save the file and use a Python interpreter.

B.

Press a run button within the editor.

C.

Upload the code to a web server.

D.

Convert the code to machine language first.

Buy Now
Questions 13

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

Options:

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

Buy Now
Questions 14

Fix the indexing error in this function that should return the last character of a string.

def get_last_character(text):

return text[len(text)]

Options:

Buy Now
Questions 15

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

Options:

A.

for number in numbers:number = number + 5

B.

for i in range(len(numbers)):numbers[i] = numbers[i] + 5

C.

for numbers in number:numbers = numbers + 5

Buy Now
Questions 16

Write a complete function calculate_discount(price, discount_percent) that calculates and returns the final price after applying a discount percentage.

For example, calculate_discount(75, 20) should return 60.0.

def calculate_discount(price, discount_percent):

# TODO: Calculate and return the final price after discount

pass

Options:

Buy Now
Questions 17

Fix the missing function call in this function that should return the uppercase version of a string.

def make_uppercase(text):

return text.upper

Options:

Buy Now
Questions 18

Complete the function get_second_item(items) that takes a list and returns the second item. Assume the input is always a list containing at least two elements.

For example, get_second_item([10, 20, 30]) should return 20.

def get_second_item(items):

# TODO: Return the second item from the list

pass

Options:

Buy Now
Exam Name: Foundations of Programming (Python) - E010 JIV1
Last Update: Sep 19, 2026
Questions: 60

PDF + Testing Engine

$55.71   $185.69

Testing Engine

$42.85   $142.83

PDF (Q&A)

$47.13   $157.11