







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
WGU E010 FOUNDATIONS OF PROGRAMMING (PYTHON) OA 2026 PRACTICE EXAM COMPLETE (100) CURRENT TESTING QUESTIONS AND CORRECT ANSWERS WITH DETAILED EXPLANATIONS|GUARANTEED PASS. PYTHON
Typology: Exams
1 / 47
This page cannot be seen from the preview
Don't miss anything!








































50
Ace the WGU E010 Foundations of Programming (Python) OA practice Exam with practice questions covering Python syntax, data types, control structures, functions, data structures (lists, tuples, dictionaries, sets), file I/O, exception handling, modules, and basic object-oriented programming. This study guide helps reinforce foundational coding concepts and supports effective preparation for objective assessments. Designed to improve problem-solving skills and boost confidence in Python programming. Suitable for computer science, IT, and programming students. Multiple choice. Section 1: Python Fundamentals s Syntax (Questions 1–15)
50 C)print("Hello, World!") D)An error occurs Answer: A. Hello, World! Explanation: The print() function outputs the string literal to the console without the quotation marks. The quotes are used only to denote the string.
Which of the following is a valid variable name in Python? A)2_variable B)my-variable C)_myVariable D)my variable Answer: C. _myVariable Explanation: Variable names can start with a letter or underscore, cannot start with a digit, and cannot contain spaces or hyphens. Underscore is allowed.
In Python, which symbol is used for single- line comments? A)// B)# C)/* D) 50 Answer: B. Explanation: type() returns the class of the object. 3. is a floating-point number, so the output indicates a float class.
Which operator is used for exponentiation (power) in Python? A)^ B)** C)* D)// Answer: B. ** Explanation: ** is the exponentiation operator (e.g., 2 ** 3 equals 8). The ^ operator is used for bitwise XOR.
What is the result of 17 // 5 in Python? A)3. B) 3 C) 4 D)3. Answer: B. 3 Explanation: // is the floor division operator; it returns the integer quotient, discarding the remainder (17 // 5 = 3). G. What is the output of print(10 % 3)? A)3. B) 1 C) 3 D) 10
50 Answer: B. 1 Explanation: % is the modulo operator; it returns the remainder of division (10 divided by 3 gives remainder 1).
50
50 A)A B)B
Page G of 44 C) 6 D)infinite Answer: B. 5 Explanation: The loop starts with count = 0. It runs while count < 5. The loop body increments count. The iterations happen when count = 0,1,2,3,4 (5 times). When count becomes 5, the condition is False and the loop stops. 1G. What is the output of this for loop? python for i in range(3): print(i, end=" ") A) 0 1 2 B) 1 2 3 C) 0 1 2 3 D) 1 2 Answer: A. 0 1 2 Explanation: range(3) generates numbers 0, 1, and 2. The loop iterates three times, printing each number with a space after it.
50 Answer: C. break Explanation: The break statement terminates the innermost loop (while or for) immediately and resumes execution after the loop.
50 else: x = 0 A) 5 B) 10 C) 0 D)None Answer: B. 10 Explanation: The condition if x: treats x as a Boolean. Non-zero numbers are True, so the if branch executes, setting x to 10.
50 break print(i, end=" ") A) 0 B) 0 1 C) 0 1 2 D)No output Answer: A. 0 Explanation: When i = 0, condition false, print 0. When i = 1, i == 1 is True, break exits the loop immediately without printing 1 or further values.
50 Section 3: Functions s Scope (Questions 31–45)
50 python def add(a, b): return a + b result = add(3, 4) print(result) A) 7 B) 12 C)add(3,4) D)Error Answer: A. 7 Explanation: The function takes two parameters and returns their sum. add(3,4) returns 7, which is assigned to result and printed.
50 Explanation: If no return statement is executed, or a return with no value, the function returns None implicitly.
50