Free PCAP™ – Certified Associate Python Programmer Practice Questions
200 free questions · Answer explanations · No signup required
View examination details, outline and sourcesLoading selected examination banks…
Sample Practice Questions
Try these 10 sample questions from the PCAP™ – Certified Associate Python Programmer practice bank. Each includes the answer and explanation. Continue with the interactive practice above to review the full question set.
1A Python program runs `import sound.effects.echo` successfully. Which expression refers to the imported module using the name made available by that statement?
- A.`sound.effects.echo`Correct answer: A
- B.`effects.echo`
- C.`echo`
- D.`sound.echo`
2When an exception is raised in a `try` suite, in what order does Python search the corresponding `except` clauses?
- A.In the order they appearCorrect answer: A
- B.From the last clause to the first
- C.From the most specific class to the least specific class
- D.In alphabetical order by exception name
3What does the notation `U+265E` identify in Unicode?
- A.A Unicode code pointCorrect answer: A
- B.A UTF-8 byte sequence
- C.A font-rendered glyph
- D.A Unicode character name
4In Python's object-oriented model, what is a class?
- A.A template for creating user-defined objectsCorrect answer: A
- B.One particular instance created from a template
- C.A stored value belonging to one instance
- D.A bound method belonging to one instance
5What is `[x * 2 for x in [1, 2, 3]]`?
- A.`[2, 4, 6]`Correct answer: A
- B.`[1, 2, 3, 1, 2, 3]`
- C.`[1, 4, 9]`
- D.`[2, 3, 4]`
6After `import foo.bar.baz as fbb` succeeds, which name directly refers to the imported `foo.bar.baz` module in the importing namespace?
- A.`foo`
- B.`bar`
- C.`fbb`Correct answer: C
- D.`baz`
7Where must a bare `except:` clause appear among the handlers of a `try` statement?
- A.Before all named handlers
- B.After all named handlersCorrect answer: B
- C.Immediately before `else` only when there is no `finally`
- D.It can appear in any handler position
8What is the relationship between ASCII text and UTF-8?
- A.Every ASCII text string is valid UTF-8 text.Correct answer: A
- B.ASCII text must always be converted to two-byte UTF-8 units.
- C.ASCII and UTF-8 use disjoint code points.
- D.Only ASCII digits are valid UTF-8 text.
9An account object has a balance attribute and methods for deposit, withdrawal, and display. Which component represents its stored state?
- A.The balance attributeCorrect answer: A
- B.The deposit method
- C.The withdrawal method
- D.The display method
10What is `[x for x in [1, 2, 3, 4] if x % 2 == 0]`?
- A.`[2, 4]`Correct answer: A
- B.`[1, 3]`
- C.`[True, False, True, False]`
- D.`[1, 2, 3, 4]`
Topics in this practice bank
These topics describe the available practice for PCAP™ – Certified Associate Python Programmer. Review the examination outline and its sources for scope and allocation details.
Modules and Packages
- Import and use modules and packages
- Perform evaluations using the math module
- Generate random values using the random module
- Discover host platform properties using the platform module
- Create and use user-defined modules and packages
Exceptions
- Handle errors using Python-defined exceptions
- Extend the exceptions hierarchy with self-defined exceptions
Strings
- Understand machine representation of characters
- Operate on strings
- Employ built-in string methods
Object-Oriented Programming
- Understand the object-oriented approach
- Employ class and object properties
- Equip a class with methods
- Discover the class structure
- Build a class hierarchy using inheritance
- Construct and initialize objects
Miscellaneous (List Comprehensions, Lambdas, Closures, I/O)
- Build complex lists using list comprehensions
- Embed lambda functions into code
- Define and use closures
- Understand basic input/output terminology
- Perform input/output operations
How to use these free practice questions
Choose an answer, check the explanation, and review your progress by chapter. Practice questions and explanations are free to access without signing up.
These are independent study questions, not actual examination items. For examination requirements and official information, view PCAP™ – Certified Associate Python Programmer details.