Python Foundation with Data Structures & Algorithms exam answers 2026: This page lists all 100 questions of the official Python Foundation with Data Structures & Algorithms exam by Itronix Solutions, each with its four answer options and the correct answer highlighted in green. Use it to revise every topic before you attempt the test and earn your verifiable certificate.
About this certification: Learn the core Python skills and become eligible to apply for Python Developer positions at Google, Microsoft, Facebook and more.
| Certification | Python Foundation with Data Structures & Algorithms |
| Provider | Itronix Solutions |
| Category | Programming & Development |
| Total questions | 100 multiple-choice questions |
| Marks | 1 mark per question (100 marks) |
| Passing score | 80% (80 out of 100) |
| Retake | Available if you do not pass |
| Certificate | Verifiable online certificate |
Take the exam: Python Foundation with Data Structures & Algorithms on Itronix Solutions. See every other Itronix exam in our complete list of Itronix certification answers.
Python Foundation with Data Structures & Algorithms Exam Questions and Answers
Questions 1 to 25
1. Which keyword defines a function in Python?
Correct answer: C. def
2. Which Python type is mutable?
Correct answer: A. list
3. What does len("hello") return?
Correct answer: A. 5
4. What is 10 // 3 in Python?
Correct answer: C. 3
5. What is 10 % 3 in Python?
Correct answer: D. 1
6. What is 2 ** 3 in Python?
Correct answer: C. 8
7. Which symbol starts a single-line comment?
Correct answer: C. #
8. Which function reads keyboard input?
Correct answer: B. input()
9. Which function prints output?
Correct answer: D. print()
10. Which of these is a valid variable name?
Correct answer: A. total_sum
11. What does type(3.5) return?
Correct answer: A. float
12. Which value is falsy in Python?
Correct answer: B. 0
13. What is the result of bool("")?
Correct answer: D. False
14. Which operator checks equality?
Correct answer: C. ==
15. Which keyword exits a loop early?
Correct answer: D. break
16. Which keyword skips to the next loop iteration?
Correct answer: D. continue
17. pass in Python is used to:
Correct answer: A. Do nothing as a placeholder
18. range(2, 8, 2) produces:
Correct answer: C. 2, 4, 6
19. Which method adds an item at the end of a list?
Correct answer: B. append()
20. Which method removes and returns the last list item?
Correct answer: A. pop()
21. my_list[-1] returns:
Correct answer: C. The last element
22. my_list[1:3] returns:
Correct answer: B. Elements at index 1 and 2
23. Which creates an empty dictionary?
Correct answer: C. {}
24. Which creates an empty set?
Correct answer: A. set()
25. Dictionary keys must be:
Correct answer: D. Hashable (immutable) values
Questions 26 to 50
26. d.get("k", 0) returns:
Correct answer: A. The value for "k" or 0 if missing
27. Which method returns all dictionary keys?
Correct answer: B. keys()
28. A set automatically:
Correct answer: C. Removes duplicate values
29. "a" in "apple" returns:
Correct answer: B. True
30. Strings in Python are:
Correct answer: B. Immutable
31. "abc".upper() returns:
Correct answer: A. ABC
32. "a,b,c".split(",") returns:
Correct answer: C. ["a", "b", "c"]
33. "-".join(["a","b"]) returns:
Correct answer: A. a-b
34. An f-string looks like:
Correct answer: D. f"Total: {x}"
35. Which keyword creates a class?
Correct answer: B. class
36. The constructor method in a class is:
Correct answer: C. __init__
37. self refers to:
Correct answer: A. The current object instance
38. Which keyword handles exceptions?
Correct answer: D. except
39. Which block runs whether or not an exception occurs?
Correct answer: B. finally
40. Raising your own exception uses:
Correct answer: A. raise
41. A lambda function is:
Correct answer: B. A small anonymous function
42. List comprehension [x*x for x in range(4)] gives:
Correct answer: D. [0, 1, 4, 9]
43. Which built-in returns the largest item?
Correct answer: B. max()
44. sorted([3,1,2]) returns:
Correct answer: D. [1, 2, 3]
45. list.sort() returns:
Correct answer: C. None (it sorts in place)
46. Which module provides math functions like sqrt?
Correct answer: D. math
47. A data structure is:
Correct answer: C. A way of organising and storing data for efficient access
48. An algorithm is:
Correct answer: B. A step-by-step procedure to solve a problem
49. Big-O notation describes:
Correct answer: D. How running time or space grows with input size
50. Accessing an element of a Python list by index is:
Correct answer: D. O(1)
Questions 51 to 75
51. Linear search has time complexity:
Correct answer: A. O(n)
52. Binary search requires the data to be:
Correct answer: C. Sorted
53. Binary search has time complexity:
Correct answer: D. O(log n)
54. Bubble sort has worst-case complexity:
Correct answer: B. O(n squared)
55. Merge sort has time complexity:
Correct answer: D. O(n log n)
56. Merge sort uses the strategy of:
Correct answer: D. Divide and conquer
57. Quick sort average time complexity is:
Correct answer: D. O(n log n)
58. Python’s built-in sort algorithm is:
Correct answer: B. Timsort
59. Insertion sort works well on:
Correct answer: A. Small or nearly sorted lists
60. A stack follows which order?
Correct answer: D. LIFO (last in, first out)
61. A queue follows which order?
Correct answer: D. FIFO (first in, first out)
62. In Python, a list can act as a stack using:
Correct answer: A. append() and pop()
63. collections.deque is efficient for:
Correct answer: A. Adding and removing at both ends
64. Checking balanced brackets is a classic use of a:
Correct answer: A. Stack
65. A linked list node usually stores:
Correct answer: B. Data and a reference to the next node
66. Inserting at the head of a singly linked list is:
Correct answer: A. O(1)
67. A doubly linked list node has references to:
Correct answer: A. Both next and previous nodes
68. A hash table provides average lookup time of:
Correct answer: A. O(1)
69. Python’s dict is implemented as a:
Correct answer: C. Hash table
70. A hash collision occurs when:
Correct answer: B. Two keys map to the same bucket
71. Recursion is when:
Correct answer: A. A function calls itself
72. Every recursive function needs a:
Correct answer: C. Base case
73. Too-deep recursion in Python raises:
Correct answer: B. RecursionError
74. The factorial of 5 is:
Correct answer: C. 120
75. The Fibonacci sequence starts:
Correct answer: C. 0, 1, 1, 2, 3, 5
Questions 76 to 100
76. Memoization helps by:
Correct answer: A. Storing results of previous calls to avoid recomputation
77. Dynamic programming solves problems by:
Correct answer: D. Combining solutions of overlapping subproblems
78. A binary tree node has at most:
Correct answer: D. Two children
79. In a binary search tree, left child values are:
Correct answer: B. Smaller than the parent
80. Inorder traversal of a BST visits nodes in:
Correct answer: D. Sorted order
81. Breadth-first traversal of a tree uses a:
Correct answer: B. Queue
82. Depth-first traversal can be implemented with:
Correct answer: C. A stack or recursion
83. The height of a balanced BST with n nodes is about:
Correct answer: A. log n
84. A heap is commonly used to implement a:
Correct answer: B. Priority queue
85. Python’s heapq module implements a:
Correct answer: B. Min-heap
86. A graph consists of:
Correct answer: A. Vertices (nodes) and edges
87. An adjacency list represents a graph by:
Correct answer: A. Storing each node’s list of neighbours
88. Dijkstra’s algorithm finds:
Correct answer: B. Shortest paths with non-negative edge weights
89. BFS on an unweighted graph finds:
Correct answer: B. Shortest paths in number of edges
90. A greedy algorithm:
Correct answer: C. Makes the best local choice at each step
91. The two-pointer technique is often used on:
Correct answer: B. Sorted arrays or strings
92. A sliding window technique helps with:
Correct answer: C. Problems on contiguous subarrays or substrings
93. Reversing a list in Python can be done with:
Correct answer: A. my_list[::-1]
94. Space complexity measures:
Correct answer: D. Extra memory used by an algorithm
95. O(1) means the operation takes:
Correct answer: C. Constant time regardless of input size
96. Which is generally the fastest growth rate to have?
Correct answer: A. O(log n)
97. Choosing the right data structure mainly improves:
Correct answer: C. Efficiency and code clarity
98. Selection sort repeatedly:
Correct answer: A. Selects the smallest remaining element and places it next
99. A tuple can be unpacked like:
Correct answer: D. a, b = (1, 2)
100. enumerate(my_list) returns:
Correct answer: A. Index and value pairs
How to Pass the Python Foundation with Data Structures & Algorithms Exam
- Read every question carefully; most options look similar, so look for the most precise answer.
- Revise the questions above topic by topic rather than memorising letters, because option order can change in the live test.
- You need 80 correct answers out of 100 to pass, so aim to understand at least 85 to stay safe.
- If you do not clear it on the first attempt, review the questions you missed and use the retake option.
Frequently Asked Questions
How many questions are in the Python Foundation with Data Structures & Algorithms exam?
The exam has 100 multiple-choice questions, each worth 1 mark.
What is the passing score for the Python Foundation with Data Structures & Algorithms?
You need at least 80% (80 out of 100) to pass and receive the certificate.
Can I retake the Python Foundation with Data Structures & Algorithms exam?
Yes. If you score below 80%, you can retry the test after reviewing the topics.
Is the Itronix certificate verifiable?
Yes. Every certificate issued by Itronix Solutions has a unique ID that can be checked on the Itronix verify-certificate page.
More Programming & Development Certification Answers
- Advanced Java Certification Exam Answers
- Android Development Certification Exam Answers
- Automation Testing Certification Exam Answers
- Blockchain Certification Exam Answers
- C & C++ Programming Language Certification Exam Answers
- Certified Quality Engineer Professional Certification Exam Answers
- Core Java Programming Professional Certification Exam Answers
- Data Structures and Algorithm Certification Exam Answers
Disclaimer: These answers are provided for learning and revision. Questions and answers are checked regularly; if you find a mistake, let us know in the comments.
Priya Dogra – Free Certifications, Exam Answers & Career Guides Free certification exam answers, courses, scholarships and career guides for learners worldwide