Docsity

Python Institute PCAP (Certified Associate in Python Programming) Practice Examination 202, Exams of Nursing

Toggle sidebar
bg1
Python Institute PCAP (Certified Associate in Python Programming) Practice
Examination 2025/2026 – 195 Multiple Choice Questions & Answers |
Complete Python Programming Certification Study Guide, Test Bank,
Practice Test, Exam Review & Test Preparation | 4-Option MCQs (A, B, C, D) |
PCAP Certification Exam Prep, Python Fundamentals, Programming
Concepts, Data Types, Control Flow, Functions, Modules, Exceptions &
Object-Oriented Programming
SECTION 1: Python Fundamentals and Data Types (Questions 1–25)
Question 1
Which of the following best describes the primary characteristic of Python as a programming language?
A. It is a low-level language requiring manual memory management.
B. It is an interpreted, high-level language with dynamic typing.
C. It is a compiled language that produces standalone executables.
D. It is a statically typed language requiring explicit variable declarations.
Correct Answer: B
Explanation: Python is interpreted, high-level, and dynamically typed, meaning variable types are
determined at runtime without explicit declarations. This enables rapid development and flexibility.
Question 2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Python Institute PCAP (Certified Associate in Python Programming) Practice Examination 202 and more Exams Nursing in PDF only on Docsity!

Python Institute PCAP (Certified Associate in Python Programming) Practice Examination 2025/2026 – 195 Multiple Choice Questions & Answers | Complete Python Programming Certification Study Guide, Test Bank, Practice Test, Exam Review & Test Preparation | 4-Option MCQs (A, B, C, D) | PCAP Certification Exam Prep, Python Fundamentals, Programming Concepts, Data Types, Control Flow, Functions, Modules, Exceptions & Object-Oriented Programming SECTION 1: Python Fundamentals and Data Types (Questions 1–25) Question 1 Which of the following best describes the primary characteristic of Python as a programming language? A. It is a low-level language requiring manual memory management. B. It is an interpreted, high-level language with dynamic typing. C. It is a compiled language that produces standalone executables. D. It is a statically typed language requiring explicit variable declarations. Correct Answer : B Explanation: Python is interpreted, high-level, and dynamically typed, meaning variable types are determined at runtime without explicit declarations. This enables rapid development and flexibility. Question 2

A developer writes the following code: python x = 10 y = 3 result = x // y print(result) What value is displayed? A. 3. B. 3 C. 4 D. 3. Correct Answer : B Explanation: The // operator performs floor division, returning the largest integer less than or equal to the quotient. Here, 10 divided by 3 equals 3.33, and floor division yields 3.

What is the output? A. [1, 2, 3] B. [1, 2, 3, 4] C. [4] D. Error Correct Answer : B Explanation: In Python, assignment b = a creates a reference to the same list object. Modifying b also modifies a, so the output is [1, 2, 3, 4]. Question 5 Which of the following is NOT a valid Python variable name? A. _myVar B. my_var C. 2myVar D. myVar

Correct Answer : C Explanation: Python variable names cannot begin with a digit. While they may contain digits, the first character must be a letter or underscore. Question 6 What is the result of the following expression? python print(type(3 / 2)) A. B. C. D. Correct Answer : B Explanation: The / operator always returns a float in Python 3, even when dividing two integers that produce a whole number. Thus, 3/2 yields 1.5, a float. Question 7

C. Error D. 5 Correct Answer : B Explanation: int("5") converts the string to integer 5, then adds 2, resulting in 7. Without conversion, string concatenation would occur or an error would arise. Question 9 Which statement about Python strings is TRUE? A. Strings are mutable and can be changed in place. B. Strings are immutable; operations create new strings. C. Strings can only contain ASCII characters. D. Strings cannot be indexed. Correct Answer : B

Explanation: Python strings are immutable. Any operation that appears to modify a string actually creates a new string object, leaving the original unchanged. Question 10 What does the following code print? python print(bool("")) print(bool(" ")) A. False, True B. True, False C. False, False D. True, True Correct Answer : A Explanation: An empty string is falsy (False), while a string containing a space is truthy (True). Any non- empty string evaluates to True in boolean context. Question 11

Correct Answer : C Explanation: The modulo operator % returns the remainder of division. 10 divided by 3 is 3 with remainder 1, so result equals 1. Question 13 Which of the following correctly creates a dictionary in Python? A. d = {1, 2, 3} B. d = dict([(1, 'a'), (2, 'b')]) C. d = [1: 'a', 2: 'b'] D. d = (1: 'a', 2: 'b') Correct Answer : B Explanation: The dict() constructor accepts an iterable of key-value pairs. Option A creates a set, while C and D use invalid syntax for dictionaries. Question 14

What is the output of print(list(range(2, 10, 3)))? A. [2, 5, 8] B. [2, 5, 8, 11] C. [3, 6, 9] D. [2, 4, 6, 8] Correct Answer : A Explanation: range(2, 10, 3) generates numbers starting at 2, incrementing by 3, stopping before 10: 2, 5, 8. The value 11 exceeds the stop value. Question 15 Which method removes and returns the last element of a list? A. remove() B. pop() C. delete() D. discard() Correct Answer : B

python x = (1,) print(type(x)) What is displayed? A. B. C. D. Correct Answer : B Explanation: A single-element tuple requires a trailing comma. Without it, (1) would be interpreted as an integer. The comma makes it a tuple. Question 18 Which of the following is a valid way to create an empty set? A. {} B. set() C. []

D. ()

Correct Answer : B Explanation: set() creates an empty set. {} creates an empty dictionary, while [] and () create an empty list and tuple respectively. Question 19 What does the is operator compare? A. Values of two objects B. Identity (memory address) of two objects C. Types of two objects D. Sizes of two objects Correct Answer : B Explanation: The is operator checks object identity, verifying whether two variables reference the same object in memory, not whether their values are equal. Question 20

D. None can only be used with numeric types. Correct Answer : C Explanation: None is a singleton object of type NoneType representing the absence of a value. It is not equal to 0 or False, though it is falsy. Question 22 What is the result of int("101", 2)? A. 101 B. 5 C. 2 D. Error Correct Answer : B Explanation: The second argument specifies base 2. Binary "101" equals 1×4 + 0×2 + 1×1 = 5 in decimal. Question 23

Which of the following creates a shallow copy of a list? A. b = a B. b = a.copy() C. b = a[:] D. Both B and C Correct Answer : D Explanation: Both a.copy() and a[:] create shallow copies. Simple assignment b = a creates a reference to the same object, not a copy. Question 24 What is the output? python print(2 ** 3 ** 2) A. 64 B. 512 C. 12 D. 36

What is the output of the following code? python for i in range(3): if i == 1: continue print(i) A. 0 1 2 B. 0 2 C. 1 D. 0 1 Correct Answer : B Explanation: The continue statement skips the rest of the loop body when i equals 1. Thus, only 0 and 2 are printed, skipping 1. Question 27 Which statement immediately terminates a loop and transfers control to the code after the loop?

A. continue B. pass C. break D. exit Correct Answer : C Explanation: break exits the innermost loop entirely. continue skips to the next iteration, pass does nothing, and exit is not a loop control statement. Question 28 Consider this code: python x = 0 while x < 5: x += 1 if x == 3: break print(x) What is printed?