PCAP - Certified Associate in Python Programming Exam Prep
Free practice questions

Free PCAP Practice Questions

10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.

Start the free practice test → ★★★★★4.9/5 from 2,400+ candidates · No signup

The PCAP exam has 40 questions and runs 1 hour 5 minutes.

These 10 free PCAP questions are organized by exam domain, so you can see how each part of the PCAP - Certified Associate in Python Programming blueprint is tested. Reveal the answer and explanation under each question.

Domain 1: Modules and Packages 12% of exam

Question 1

What is the output of the following code? import math print(math.floor(-3.5), math.trunc(-3.5), int(-3.5))

Show answer & explanation

Correct answer: A - -4 -3 -3

Question 2

A developer writes the following two lines and runs them on a standard CPython 3 installation: import platform print(platform.python_version_tuple()[0] + 1) What is the result?

Show answer & explanation

Correct answer: C - A TypeError, because the tuple contains strings, not integers

Domain 2: Exceptions 14% of exam

Question 3

What happens when the following code is executed? try: print(1 / 0) except Exception: print('general') except ZeroDivisionError: print('specific')

Show answer & explanation

Correct answer: B - general is printed

Question 4

What is the output of the following code? def check(): try: return 'try' finally: return 'finally' print(check())

Show answer & explanation

Correct answer: B - finally, because it replaces the value returned earlier

Question 5

A script contains the following code. What appears on standard output? import sys try: sys.exit(1) except Exception: print('caught') print('done')

Show answer & explanation

Correct answer: D - Nothing is printed; the script terminates immediately

Domain 3: Strings 18% of exam

Question 6

What is the output of the following code? print('www.example.com'.strip('cmowz.'))

Show answer & explanation

Correct answer: C - example

Question 7

What is the output of the following code? print('a,,b,'.split(','))

Show answer & explanation

Correct answer: D - ['a', '', 'b', '']

Question 8

What is the output of the following code? print('Zebra' < 'apple', '10' < '9')

Show answer & explanation

Correct answer: A - True True

Question 9

What is the output of the following code? print('certification'[::-3])

Show answer & explanation

Correct answer: B - ntitc

Domain 4: Object-Oriented Programming 34% of exam

Question 10

What is the output of the following code? class Snake: victims = 0 def __init__(self, name): self.name = name Snake.victims += 1 a = Snake('Ka') b = Snake('Nag') b.victims = 99 c = Snake('Hiss') print(Snake.victims, a.victims, b.victims)

Show answer & explanation

Correct answer: C - 3 3 99

The rest of the PCAP blueprint

The PCAP exam also covers these domains. Drill them in the full free practice test:

That's 10 of 1,030

The full bank has 1,020 more PCAP questions with explanations.

Continue in the free practice test →

View plans