WGU certification preparation
Foundations-of-Programming-Python Practice Questions
Practice exam-style questions, check your answers, and review explanations and source references where they are available.
- Exam
- Foundations-of-Programming-Python
- Provider
- WGU
- Full set
- 60 questions
- Last Update Check
Be fully prepared for how you will be tested on the actual FOUNDATIONS-OF-PROGRAMMING-PYTHON exam with our authentic, exam-emulating questions. We invite you to try our free FOUNDATIONS-OF-PROGRAMMING-PYTHON practice questions directly on this page. When you complete the practice quiz, you can view the correct choices along with our detailed answer explanations for why each option is right or wrong. To get full access to our complete FOUNDATIONS-OF-PROGRAMMING-PYTHON question bank, you can purchase our premium preparation package.
Question 1 discussion
Question 2 discussion
Question 3 discussion
Question 4 discussion
Question 5 discussion
SIMULATION Complete the function double_number(num) that takes one number parameter and returns double that number. For example, double_number(5) should return 10. def double_number(num): # TODO: Return double the input number # Example: double_number(5) should return 10 pass
Question 6 discussion
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
Question 7 discussion
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
Question 8 discussion
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]
Question 9 discussion
SIMULATION Complete the function is_positive(number) that returns True if the number is greater than 0, and False otherwise. def is_positive(number): # TODO: Return True if number > 0, False otherwise pass
Question 10 discussion
Source context
How this practice set is maintained
Maintained by the CertMage content team, this page loads questions from the exam dataset connected to its preparation resource. When an answer includes a supporting reference, it is shown with that answer so you can review the underlying vendor documentation.
Certification objectives, interfaces, and vendor services can change. Verify important details against the provider's current exam guide and documentation before your exam.
