
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































2026 Edition Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
Exam Overview This original practice exam covers computer programming fundamentals, Python syntax, data types and operators, input and output, control flow, lists, tuples, dictionaries and strings, functions, scope, and exception handling. It is not an official Python Institute exam and does not reproduce exam content. Behavior can vary by version, so please confirm against current Python documentation. Exam Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original Questions with Answers Intended for Beginners studying Python fundamentals and entry- level programming certification Number of questions 300 multiple-choice (four options, one best answer) Content areas 9 Suggested time 5 hours (about 60 seconds per question) Suggested passing target 80% or higher (240 of 300) Answer format The correct answer and explanation appear directly after each question
Content area Questions Share of exam Programming Fundamentals and Syntax
Data Types and Operators 33 11% Input, Output and Strings 33 11% Conditions and Loops 33 11% Lists and Tuples 33 11% Dictionaries and Sets 33 11% Functions and Scope 33 11% Exceptions and Modules 33 11% Scenarios and Best Practices 36 12%
Cover the answer lines with a sheet of paper and attempt each question before checking. Work one content area at a time, or take all questions in one timed sitting to simulate test day. Mark every question you miss or guess on, then reread its explanation and the related reference material. Repeat the missed questions after a few days; aim to explain why each wrong option is wrong.
General Python 3 fundamentals (confirm against current Python documentation) Note: This is an independent practice resource written to the published content areas for this exam. It is not affiliated with or endorsed by the testing organization, and it does not contain actual exam questions. Laws, codes, fees and guidelines change; confirm current requirements with the official candidate handbook and references. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
Section 1: Programming Fundamentals and Syntax
1. Python is: A. A compiled-only language B. An assembly language C. An interpreted high-level language D. A markup language Correct answer: C. An interpreted high-level language Explanation: Fun. 2. Python source files typically end with: A. .py B. .pt C. .python D. .exe Correct answer: A. .py Explanation: Fun. 3. The interpreter executes code: A. Only after full machine compile always B. Line by line C. A file run as a program D. No value Correct answer: B. Line by line Explanation: Fun. 4. A comment in Python starts with: A. // B. -- C. /* D. # Correct answer: D. # Explanation: Fun. 5. Indentation in Python: A. Defines code blocks B. Is optional decoration C. Is ignored D. Marks comments Correct answer: A. Defines code blocks Explanation: Fun. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
6. A statement ending with a colon usually starts: A. A comment B. A string C. A number D. A block Correct answer: D. A block Explanation: Fun. 7. The print function: A. Reads input B. Defines variables C. Outputs text to the console D. Imports modules Correct answer: C. Outputs text to the console Explanation: Fun. 8. A variable is: A. A fixed constant only B. A named reference to a value C. A keyword D. A comment Correct answer: B. A named reference to a value Explanation: Fun. 9. Variable names cannot: A. Contain letters B. Contain underscores C. Start with a digit D. Contain digits Correct answer: C. Start with a digit Explanation: Fun. 10. Python is case-sensitive means: A. They are the same B. Case is ignored C. Names are uppercase D. Name and name are different Correct answer: D. Name and name are different Explanation: Fun. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
16. The len function returns: A. The type B. The sum C. The max D. The number of items or characters Correct answer: D. The number of items or characters Explanation: Fun. 17. The exit of a program normally occurs: A. At random B. Is style not syntax in most cases C. After 10 lines D. When the last statement completes Correct answer: D. When the last statement completes Explanation: Fun. 18. A syntax error occurs: A. When logic is wrong B. When code violates language rules C. At runtime only D. A file run as a program Correct answer: B. When code violates language rules Explanation: Fun. 19. A runtime error occurs: A. While the program is running B. Before parsing C. When code violates language rules D. At install Correct answer: A. While the program is running Explanation: Fun. 20. A logic error means: A. The program does not start B. Syntax is wrong C. The program runs but gives wrong results D. Indentation is right Correct answer: C. The program runs but gives wrong results Explanation: Fun. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
21. Python 3 integer division operator is: A. / B. // C. % D. ** Correct answer: B. // Explanation: Fun. 22. The remainder operator is: A. % B. // C. / D. ** Correct answer: A. % Explanation: Fun. 23. The exponent operator is: A. ^ B. // C. % D. ** **Correct answer: D. **** Explanation: Fun. 24. PEP 8 is: A. A library B. A keyword C. The Python style guide D. An error Correct answer: C. The Python style guide Explanation: Fun. 25. Docstrings document: A. Functions, classes and modules B. Only variables C. Only loops D. Only errors Correct answer: A. Functions, classes and modules Explanation: Fun. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
31. Whitespace around operators: A. Is style not syntax in most cases B. Is always an error C. Changes meaning always D. Is banned Correct answer: A. Is style not syntax in most cases Explanation: Fun. 32. Line continuation can use: A. A semicolon only B. A colon C. A hash D. A backslash or parentheses Correct answer: D. A backslash or parentheses Explanation: Fun. 33. Multiple statements on one line use: A. A colon B. A comma C. A hash D. A semicolon Correct answer: D. A semicolon Explanation: Fun. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
Section 2: Data Types and Operators
34. The int type stores: A. Whole numbers B. Decimals C. Text D. Booleans only Correct answer: A. Whole numbers Explanation: Typ. 35. The float type stores: A. Whole numbers only B. Whole numbers C. Numbers with decimals D. Order of evaluation Correct answer: C. Numbers with decimals Explanation: Typ. 36. The str type stores: A. Numbers B. Text C. Booleans D. Lists Correct answer: B. Text Explanation: Typ. 37. The bool type has values: A. True and False B. Yes and No C. 1 and 2 D. On and Off Correct answer: A. True and False Explanation: Typ. 38. Result of 7 // 2 is: A. 2 B. 3 C. 3. D. 4 Correct answer: B. 3 Explanation: Typ. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
44. Which has higher precedence? A. Addition over multiplication B. Whole numbers C. Both operands are true D. Multiplication over addition Correct answer: D. Multiplication over addition Explanation: Typ. 45. Result of int(3.9) is: A. 4 B. 3 C. 3. D. 3. Correct answer: B. 3 Explanation: Typ. 46. Result of float(5) is: A. 5 B. 0. C. 5. D. 50 Correct answer: C. 5. Explanation: Typ. 47. Result of str(12) is: A. 12 B. '12' C. 12. D. 'twelve' Correct answer: B. '12' Explanation: Typ. 48. Result of bool(0) is: A. False B. True C. 0 D. 3 Correct answer: A. False Explanation: Typ. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
49. Result of bool('') is: A. True B. Identity C. Error D. False Correct answer: D. False Explanation: Typ. 50. Result of bool('a') is: A. True B. False C. tuple D. Error Correct answer: A. True Explanation: Typ. 51. Result of round(2.5) is: A. 3 B. 2. C. 2 D. Error Correct answer: C. 2 Explanation: Typ. 52. Which operator tests inequality? A. == B. != C. = D. <> Correct answer: B. != Explanation: Typ. 53. The and operator returns True when: A. Either is true B. Neither is true C. One is false D. Both operands are true Correct answer: D. Both operands are true Explanation: Typ. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
*59. Result of x = 5; x = 2 gives x: A. 7 B. 10 C. 25 D. 52 Correct answer: B. 10 Explanation: Typ. 60. Result of 1_000 as int: A. 1000 B. Error C. 100 D. 10 Correct answer: A. 1000 Explanation: Typ. 61. Result of 0.1 + 0.2 may be: A. 0.3 exactly B. 0 C. Error D. 0. Correct answer: D. 0. Explanation: Typ. 62. Integer size in Python 3: A. 32 bits fixed B. Limited by memory C. 64 bits fixed D. 8 bits Correct answer: B. Limited by memory Explanation: Typ. 63. Complex numbers use suffix: A. j B. i C. c D. z Correct answer: A. j Explanation: Typ. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
64. Result of abs(-4) is: A. - B. 0 C. 4 D. Error Correct answer: C. 4 Explanation: Typ. 65. Result of max(2, 9, 4) is: A. 2 B. 4 C. 9 D. 15 Correct answer: C. 9 Explanation: Typ. 66. Result of min(2, 9, 4) is: A. 2 B. 4 C. 9 D. 15 Correct answer: A. 2 Explanation: Typ. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
72. Default end of print is: A. A newline B. A space C. A tab D. Multi-line strings Correct answer: A. A newline Explanation: IO. 73. Strings are enclosed in: A. Only single B. Only double C. Single or double quotes D. Returns uppercase text Correct answer: C. Single or double quotes Explanation: IO. 74. Triple quotes create: A. Numbers B. Multi-line strings C. Lists D. Errors Correct answer: B. Multi-line strings Explanation: IO. 75. Escape sequence for newline is: A. \t B. \r C. D. \n Correct answer: D. \n Explanation: IO. 76. Escape sequence for tab is: A. \t B. \n C. \s D. \b Correct answer: A. \t Explanation: IO. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original
77. String concatenation uses: A. & B.. C. + D. , Correct answer: C. + Explanation: IO. 78. String repetition uses: A. + B. * C. / D. % **Correct answer: B. *** Explanation: IO. 79. Result of 'ab' * 2 is: A. 'abab' B. 'ab2' C. 'aabb' D. Error Correct answer: A. 'abab' Explanation: IO. 80. Result of 'Hi' + '!' is: A. 'Hi !' B. 'Hi' C. Error D. 'Hi!' Correct answer: D. 'Hi!' Explanation: IO. 81. Indexing starts at: A. 1 B. 0 C. - D. 2 Correct answer: B. 0 Explanation: IO. Entry-Level Python Programmer Practice Exam (PCEP Topics: Basics, Data Types, Control Flow, Data Collections, Functions, Exceptions) - 300 Original