2026 Actual WGU Foundations-of-Programming-Python Dumps, Updated Exam Questions for Guaranteed Pass

Foundations of Programming (Python) - Free Practice Questions with Explanations, Exam Dumps, and Complete Practice Pack from DumpsProvider.

Exam Information

VendorWGU
Exam codeFoundations-of-Programming-Python
Exam nameFoundations of Programming (Python)
Questions in pack60
Last updatedNovember 21, 2026
VersionE010, JIV1
Related certificationsWGU Courses and Certifications

Free practice questions with explanations

WGU Foundations-of-Programming-Python Practice Questions

Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.

Questions
18
Answered
0
Correct
0
Score
-
  1. 1 Question 1 Single choice Variables, Data Types, and Basic Operations

    A logistics team stores shipment weights read from a CSV file as strings such as "12.5" and "7". A script must compute the total weight and print it with exactly one decimal place. The team has a strict rule that the script must not lose precision by converting weights to integers. Which approach meets all requirements?

  2. 2 Question 2 Single choice Control Flow and Decision Making

    A warehouse script assigns a shipping tier to each order. Orders weighing more than 50 kg always go to the heavy tier, unless the order is marked express, in which case they go to the priority tier. Orders of 50 kg or less go to the standard tier. A developer writes a chain of if/elif statements and notices that express orders over 50 kg are reaching the heavy tier. Which correction resolves the defect without changing the behaviour for other orders?

  3. 3 Question 3 Single choice Loops and Iteration

    A data quality script reads a list of sensor readings in which a value of -999 marks a failed sensor. The script must process every valid reading, skip failed readings, and stop completely as soon as it encounters a reading whose value is None, because that indicates the feed has been truncated. A developer wants the loop to behave correctly on all three cases. Which loop structure meets the requirement?

  4. 4 Question 4 Single choice Functions and Modular Programming

    A team maintains a reporting module in which a function apply_discount(price, rate) multiplies the price by (1 - rate) and returns the result. A later refactor adds a global variable TAX_RATE and a second function, total_with_tax(price), that references TAX_RATE. A junior developer inserts the line TAX_RATE = 0.2 inside total_with_tax before using it, and the module now raises UnboundLocalError on the first call. The team needs total_with_tax to read the module-level value and must avoid duplicating the constant. What is the correct fix?

  5. 5 Question 5 Single choice Data Structures and Input/Output

    A school district stores student records in a Python dictionary keyed by student ID, with each value being a tuple of (name, grade_level). A reporting script must print each student's name and grade level in ascending order of student ID. The IDs are strings such as "S1042" and "S998", and the district has confirmed that lexicographic ordering of the strings is the intended order. The data must not be modified in place. Which code achieves this?

  6. 6 Question 6 Single choice Variables, Data Types, and Basic Operations

    A finance application stores monetary amounts as float values. An auditor reports that summing 0.1 ten times yields a total that is not exactly 1.0, and the application's end-of-day check fails. The company policy forbids rounding errors in currency calculations, and every amount has at most two decimal places. The developer must change the representation with the least disruption to existing integer and string handling in the program. Which change best meets the requirement?

  7. 7 Question 7 Single choice Control Flow and Decision Making

    A access-control function must grant entry only when a user is an active employee, or when the user is a contractor whose contract has not expired and who has a badge number on file. The function receives boolean flags active_employee, contractor, contract_valid, and has_badge. A reviewer notes that the draft expression active_employee or contractor and contract_valid and has_badge grants access to contractors with no badge in some cases. Which expression correctly implements the policy?

  8. 8 Question 8 Single choice Loops and Iteration

    A text-processing utility must count how many times each vowel appears in a user-supplied string, ignoring case and ignoring non-letter characters. The string may be very long, and the team runs the utility on a shared server where memory is constrained. The team wants the simplest correct solution that iterates through the characters of the string directly. Which implementation is best?

  9. 9 Question 9 Single choice Data Structures and Input/Output

    A small clinic receives appointment requests as lines typed into a console program. Each line has the form name,date,time, for example Lee,2026-06-01,09:30. The program must reject any line that does not contain exactly three comma-separated fields, and must print a message identifying the bad line rather than crashing. The clinic also requires that blank lines be ignored silently. Which approach satisfies all of these rules?

  10. 10 Question 10 Single choice Functions and Modular Programming

    A developer wrote a function compute_average(values) that returns the arithmetic mean of a list of numbers. A colleague calls compute_average([]) during testing and the program raises ZeroDivisionError. The team wants the function to return None for an empty input and to keep its existing contract for non-empty input. The function is called from many modules, so the signature must not change. Which implementation achieves this?

  11. 11 Question 11 Single choice Variables, Data Types, and Basic Operations

    A script reads a configuration value from a text file. The value is the string "0" when a feature is disabled and "1" when enabled, but a developer has written if flag: intending to test for enabled. The team now sees the feature active when the file contains "0". The file format cannot change because other systems depend on it. Which correction is the most precise fix?

  12. 12 Question 12 Single choice Loops and Iteration

    A batch job processes a list of customer IDs and calls an external service for each one. The service returns HTTP 429 when the rate limit is exceeded, and the team's policy is to wait and retry the same ID up to three times before logging a failure and moving to the next ID. The retry logic must not affect IDs that succeed on the first attempt. Which loop design implements this policy correctly?

  13. 13 Question 13 Multiple choice Data Structures and Input/Output

    A data engineer is preparing a Python program that reads a text file of product records, one per line, in the form sku,quantity,price. The file may contain a header line, blank lines, and lines with malformed numbers. The program must total quantity times price for valid records and write rejected lines to a separate file for review. The original file must never be modified. Which TWO implementation choices together meet these requirements? (Choose two.)

  14. 14 Question 14 Multiple choice Control Flow and Decision Making

    A subscription service decides whether a customer receives a loyalty discount. The customer qualifies if they have been a member for at least 12 months and have made no more than two late payments, or if they hold a corporate account regardless of tenure or payment history. The program has variables months_member, late_payments, and corporate. Which TWO conditional expressions are correct implementations of this rule? (Choose two.)

  15. 15 Question 15 Multiple choice Functions and Modular Programming

    A payroll module contains the function calculate_overtime(hours, rate), which returns the overtime pay for hours above 40 at 1.5 times the rate. Another developer must call it from a separate script and also reuse it in a unit test without running the full payroll report. Which TWO practices make the function reusable and testable as described? (Choose two.)

  16. 16 Question 16 Multiple choice Variables, Data Types, and Basic Operations

    A mobile app stores a user's age as the string "34" read from a form. The app must check whether the age is at least 18 before showing a restricted feature, and it must also display the age plus one year on a confirmation screen. A developer also needs to make sure a blank field does not crash the program. Which TWO code approaches correctly accomplish these requirements? (Choose two.)

  17. 17 Question 17 Single choice Loops and Iteration

    A teacher wants a program to print the numbers from 1 to 100 that are divisible by 7, but it must stop printing as soon as a number divisible by 49 appears, because the remaining numbers are reserved for a later exercise. A student has written a loop that prints the correct values up to 49 but then keeps printing 56, 63, and so on. Which change makes the loop stop at the first multiple of 49?

  18. 18 Question 18 Single choice Functions and Modular Programming

    A developer defines a function with a mutable default argument: def add_item(item, cart=[]): cart.append(item); return cart. In a web application, separate customers report that their carts contain items from other customers' sessions. The team must fix the defect while preserving the call signature add_item(item) for existing callers. Which change is correct?

These are 18 of the 60 questions in the full Foundations-of-Programming-Python pack.

Get All 60 Questions

Get all 60 questions & answers

740 Satisfied customers
93.6% Pass rate feedback
81.2% Said questions matched
96% Found material helpful

Full access options for WGU Foundations-of-Programming-Python

Self-study

PDF Version

$40.00 $20.00
  • 60 actual exam questions
  • Compatible with all devices
  • Printable PDF format
  • No download limits
  • 90 days free updates
  • 24/7 customer support

Exam simulation

Online Practice Test

$50.00 $25.00
  • 60 actual exam questions
  • Actual exam environment
  • 90 days free updates
  • Browser-based software
  • 24/7 customer support

100% Money Back Guarantee

Your success comes first

At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the Foundations-of-Programming-Python Exam (Foundations of Programming (Python)) on your very first attempt.

In a rare case, if you fail your exam, we will refund your amount without asking a single question.

100%

Security & Privacy

10000+

Satisfied Customers

24/7

Committed Service

100%

Money Back Guranteed