WGU E010 Foundations of Programming (Python) 2026 Practice Assessment, Exams of Computer Networks

WGU E010 Foundations of Programming (Python) 2026 Practice Assessment

Typology: Exams

2025/2026

Available from 05/26/2026

dennis-githinji-1
dennis-githinji-1 ๐Ÿ‡บ๐Ÿ‡ธ

1.7K documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 | P a g e
WGU E010 Foundations of Programming (Python)
2026 Practice Assessment
1. Which symbol begins a single-line comment in Python?
A. //
B. #
C. *
D. %
Answer: B. #
Rationale: Python uses # for single-line comments.
2. What data type is 3.14?
A. Integer
B. Float
C. String
D. Boolean
Answer: B. Float
Rationale: Numbers with decimals are floats.
3. What follows the in keyword in a for loop?
A. Condition
B. Iterable
C. Number
D. Function
Answer: B. Iterable
Rationale: Loops iterate over lists, strings, etc.
4. Which loop is used when the number of iterations is known?
A. while
B. for
C. infinite
D. do-while
Answer: B. for
Rationale: for loops iterate a fixed number of times.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download WGU E010 Foundations of Programming (Python) 2026 Practice Assessment and more Exams Computer Networks in PDF only on Docsity!

WGU E010 Foundations of Programming (Python)

2026 Practice Assessment

1. Which symbol begins a single-line comment in Python? A. // B. # C. * D. % Answer: B. # Rationale: Python uses # for single-line comments. 2. What data type is 3.14? A. Integer B. Float C. String D. Boolean Answer: B. Float Rationale: Numbers with decimals are floats. 3. What follows the in keyword in a for loop? A. Condition B. Iterable C. Number D. Function Answer: B. Iterable Rationale: Loops iterate over lists, strings, etc. 4. Which loop is used when the number of iterations is known? A. while B. for C. infinite D. do-while Answer: B. for Rationale: for loops iterate a fixed number of times.

5. A while loop requires: A. Variable only B. Condition + indented block C. Break statement D. List Answer: B. Condition + indented block Rationale: Loop runs while condition is True. 6. Which keyword exits a loop early? A. stop B. break C. return D. exit Answer: B. break Rationale: break terminates loop immediately. 7. In for item in list, item is: A. Index B. Value C. Length D. List Answer: B. Value Rationale: Iterates over elements. 8. Which structure prevents duplicates? A. List B. Tuple C. Dictionary D. Set Answer: D. Set Rationale: Sets store unique values only. 9. Which is immutable? A. List B. Dict

Answer: B Rationale: Python shell executes line-by-line.

14. Slice last 3 characters: A. [:3] B. [3:] C. [-3:] D. [:-3] Answer: C Rationale: Negative slicing starts from end. 15. .find("python") index in "learning python": A. 8 B. 9 C. 10 D. 7 Answer: B Rationale: Starts at index 9. 16. Which adds element to list? A. add() B. insert() C. append() D. push() Answer: C Rationale: .append() adds to end. 17. Dictionary update syntax: A. dict.add() B. dict[key] = value C. dict.insert() D. dict.append() Answer: B Rationale: Assign value using key.

18. Correct loop: A. for i with list B. for i in list C. for i from list D. for i = list **Answer: B

  1. Loop through list values:** A. while B. for value in list C. for i in range(list) D. while list **Answer: B
  2. Positive numbers condition:** A. > B. >= C. != D. < **Answer: A
  3. Double a number:** A. num+ B. num* C. num/ D. num- 2 **Answer: B
  4. Default parameter syntax:** A. name:World B. name="World" C. name==World D. name->World Answer: B

Answer: B

28. Even number check fix: A. return True B. return False C. return number%2== D. pass **Answer: C

  1. Larger number logic:** A. return smaller B. return larger C. return both D. return none **Answer: B
  2. range(5) produces:** A. 1โ€“ 5 B. 0โ€“ 4 C. 1โ€“ 4 D. 0โ€“ 5 **Answer: B
  3. len("hello") =** A. 4 B. 5 C. 6 D. 3 **Answer: B
  4. Index starts at:** A. 1 B. 0

C. - 1

D. 2

Answer: B

33. Boolean values are: A. 1/ B. Yes/No C. True/False D. T/F **Answer: C

  1. Function keyword:** A. func B. define C. def D. function **Answer: C
  2. Return keyword does:** A. prints B. exits function with value C. loops D. stores **Answer: B
  3. List index access:** A. list(0) B. list[0] C. list{0} D. list<0> **Answer: B
  4. Add multiple items:**

42. String concatenation uses: A. + B. * C. & D. % **Answer: A

  1. Multiply string:** A. "a"*3 โ†’ "aaa" B. "a"+ C. "a"/ D. "a"- 3 **Answer: A
  2. type(5) returns:** A. int B. float C. str D. bool **Answer: A
  3. Convert string to int:** A. int() B. str() C. float() D. bool() **Answer: A
  4. Logical AND operator:** A. && B. and C. & D. &&& Answer: B

47. Logical OR operator: A. || B. or C. | D. // **Answer: B

  1. NOT operator:** A.! B. not C. != D. no **Answer: B
  2. Equality check:** A. = B. == C. === D. != **Answer: B
  3. Not equal operator:** A. <> B. != C. =! D. == **Answer: B
  4. What does input() return by default?** A. Integer B. Float C. String D. Boolean

A. Division B. Modulus C. Floor division D. Power Answer: C Rationale: Returns integer division result.

57. Modulus operator is: A. / B. % C. // D. ** **Answer: B

  1. 5 % 2 equals:** A. 2 B. 1 C. 0 D. 3 **Answer: B
  2. Which is mutable?** A. Tuple B. String C. List D. Integer **Answer: C
  3. Remove item from list:** A. delete() B. remove() C. pop() D. Both B and C Answer: D Rationale: remove() removes by value, pop() by index.

61. pop() returns: A. Nothing B. Removed item C. Index D. Boolean **Answer: B

  1. len([1,2,3,4]) =** A. 3 B. 4 C. 5 D. 2 **Answer: B
  2. Which method converts string to lowercase?** A. lower() B. small() C. down() D. case() **Answer: A
  3. Convert to uppercase:** A. upper() B. capitalize() C. big() D. up() **Answer: A
  4. Remove whitespace:** A. trim() B. strip() C. remove() D. clean()

C. dict.insert() D. dict.append() Answer: B

71. Check key existence: A. key in dict B. key.exists() C. dict.has(key) D. dict.check() **Answer: A

  1. What is None?** A. String B. Boolean C. Null value D. Integer **Answer: C
  2. Which loop runs at least once?** A. for B. while C. do-while D. none Answer: D Rationale: Python has no do-while loop. 74. Function without return gives: A. Error B. 0 C. None D. False **Answer: C
  3. Default function return type:**

A. int B. str C. None D. bool Answer: C

76. Keyword for optional loop skip: A. break B. skip C. continue D. pass **Answer: C

  1. pass does:** A. Skips loop B. Ends program C. Does nothing D. Breaks loop **Answer: C
  2. Which creates empty list?** A. list() B. [] C. Both D. None **Answer: C
  3. Which creates empty dictionary?** A. {} B. dict() C. Both D. [] Answer: C

85. Boolean AND truth: A. Both True B. One True C. Both False D. Either **Answer: A

  1. Boolean OR truth:** A. Both True B. One True C. Both False D. Neither **Answer: B
  2. not True =** A. True B. False C. None D. Error **Answer: B
  3. Which is correct comparison?** A. = B. == C. := D. === **Answer: B
  4. Function parameter is:** A. Input variable B. Output value C. Loop D. Condition

Answer: A

90. Argument is: A. Function name B. Passed value C. Loop variable D. Condition **Answer: B

  1. Local variable scope:** A. Global B. Inside function C. Outside program D. Everywhere **Answer: B
  2. Global variable scope:** A. Inside function B. Entire program C. Loop only D. Class only **Answer: B
  3. Which keyword modifies global variable?** A. global B. var C. static D. extern **Answer: A
  4. List slicing [1:3] means:** A. index 1โ€“ 3 B. index 1โ€“ 2