PCAP Study Guide 2026
Everything you need to pass the PCAP exam in one place: the exam format, every topic to study, real practice questions with explanations, flashcards, and full-length practice tests. Free, no sign-up needed.
📋 PCAP Exam Format at a Glance
📚 PCAP Topics to Study (23)
✍️ Sample PCAP Questions & Answers
1. What does `str.strip()` do?
`strip()` removes whitespace (or specified characters) from both ends of the string.
2. How do you check if a key exists in a dictionary?
The in keyword is used to check if a key exists in a dictionary
3. Which exception is raised when accessing an index that does not exist in a list?
`IndexError` is raised when a sequence subscript is out of range.
4. What does `file.readlines()` return?
`readlines()` reads all lines and returns them as a list of strings including newline characters.
5. What is a decorator in Python?
A decorator is a callable that takes a function and returns a new function with added behavior.
6. Which built-in decorator marks a method that receives the class object (not an instance) as its first implicit argument?
`@classmethod` methods receive `cls` as their first argument, giving them access to the class itself so they can create alternative constructors or access class-level state.