Skip to main content
Python Institute

Python Institute PCAP — Certified Associate in Python Programming (PCAP-31-03) - 340 Questions

By Webmaster Certland English ❤️ 0 likes

Practice exam for the Python Institute PCAP – Certified Associate in Python Programming certification. Covers modules, exceptions, OOP fundamentals, OOP advanced, and generators/iterators/closures.

Sample Questions — Python Institute PCAP — Certified Associate in Python Programming (PCAP-31-03) - 340 Questions

5 free sample questions from this practice exam. Correct answers are highlighted.

1. What is the output of the following code? import math print(math.floor(3.7))

A 4
B 3 ✓ Correct
C 3.7
D TypeError

2. Which statement correctly imports only the sqrt function from the math module?

A import math.sqrt
B import sqrt from math
C from math import sqrt ✓ Correct
D import math, sqrt

3. What does the following code print? import sys print(type(sys.path))

A ✓ Correct
B
C
D

4. A developer runs a Python script directly with `python my_script.py`. What is the value of `__name__` inside my_script.py?

A '__name__'
B 'my_script'
C 'my_script.py'
D '__main__' ✓ Correct

5. What is the output of the following code? import math as m print(m.pi)

A 3.14
B 3.141592653589793 ✓ Correct
C math.pi
D NameError

Want to test yourself for real?

Create a free account and run our exam simulation engine.

Free No credit card
  • Simulation engine
  • Up to 10 questions per attempt
  • Score & basic stats
Create free account Already have an account? Sign in
Best
Premium Premium
  • All 340 questions
  • Detailed explanations
  • Smart Practice + Focus Mode
⭐ Get Premium

Related Exams

Discussion

No comments yet. Be the first to start the discussion!

Sign in to join the discussion.