Docsity

PYTHON INSTITUTE CERTIFIED ENTRY LEVEL PYTHON PROGRAMMER EXAMINATION (PCEP) PRACTICE EXAM, Exams of Computer Science

Toggle sidebar
bg1
PYTHON INSTITUTE CERTIFIED ENTRY-
LEVEL PYTHON PROGRAMMER
EXAMINATION (PCEP) PRACTICE EXAM
QUESTIONS AND CORRECT ANSWERS
(VERIFIED ANSWERS) PLUS RATIONALES
2026 Q&A | INSTANT DOWNLOAD PDF
1. What is the output of print(type(10))?
A) <class 'float'>
B) <class 'str'>
C) <class 'int'>
D) <class 'bool'>
Answer: C) <class 'int'>
Rationale: The value 10 is a whole number without decimals, so Python
classifies it as an integer type (int). The type() function returns the data
type of the object.
2. Which keyword is used to define a function in Python?
A) func
B) define
C) def
D) function
Answer: C) def
Rationale: In Python, def is the reserved keyword used to define a
function. It signals the start of a function declaration.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download PYTHON INSTITUTE CERTIFIED ENTRY LEVEL PYTHON PROGRAMMER EXAMINATION (PCEP) PRACTICE EXAM and more Exams Computer Science in PDF only on Docsity!

PYTHON INSTITUTE CERTIFIED ENTRY-

LEVEL PYTHON PROGRAMMER

EXAMINATION (PCEP) PRACTICE EXAM

QUESTIONS AND CORRECT ANSWERS

(VERIFIED ANSWERS) PLUS RATIONALES

2026 Q&A | INSTANT DOWNLOAD PDF

  1. What is the output of print(type(10))? A) B) C) D) **Answer: C) ** Rationale: The value 10 is a whole number without decimals, so Python classifies it as an integer type (int). The type() function returns the data type of the object.
  2. Which keyword is used to define a function in Python? A) func B) define C) def D) function Answer: C) def Rationale: In Python, def is the reserved keyword used to define a function. It signals the start of a function declaration.
  1. What is the correct file extension for Python files? A) .pt B) .pyt C) .py D) .python Answer: C) .py Rationale: Python source code files are saved with the .py extension, which the interpreter recognizes for execution.
  2. Which of the following is immutable? A) list B) dictionary C) set D) tuple Answer: D) tuple Rationale: Tuples cannot be changed after creation, making them immutable, unlike lists, dictionaries, and sets.
  3. What does len("Python") return? A) 5 B) 6 C) 7 D) Error Answer: B) 6 Rationale: The string "Python" contains six characters, and len() returns the number of elements in a sequence.
  4. Which operator is used for exponentiation? A) ^

Answer: C) # comment Rationale: Python uses the hash symbol (#) for single-line comments. 10.What does input() function return? A) int B) float C) string D) boolean Answer: C) string Rationale: The input() function always returns user input as a string, regardless of what is entered. 11.Which keyword is used for conditional branching? A) loop B) if C) switch D) case Answer: B) if Rationale: Python uses if for conditional execution of code blocks. 12.What is the result of 10 // 3? A) 3. B) 3 C) 4 D) 3. Answer: B) 3 Rationale: The // operator performs floor division, returning the largest integer less than or equal to the result.

13.Which of these is a valid variable name? A) 1variable B) variable_ C) variable- 1 D) variable 1 Answer: B) variable_ Rationale: Variable names can include letters, numbers, and underscores but cannot start with a number or contain spaces/hyphens. 14.What is the output of bool(0)? A) True B) False C) None D) Error Answer: B) False Rationale: In Python, 0 is considered falsy, so converting it to boolean returns False. 15.Which loop executes at least once? A) for B) while C) do-while D) None Answer: D) None Rationale: Python does not have a built-in do-while loop; both for and while may not execute at all depending on condition. 16.What is the output of type([])? A) tuple B) list

Rationale: The .lower() method converts all characters in a string to lowercase. 20.Which symbol is used for equality comparison? A) = B) == C) != D) => Answer: B) == Rationale: == checks whether two values are equal, while = is assignment. 21.What does range(3) produce? A) 1,2, B) 0,1, C) 0,1,2, D) 1, Answer: B) 0,1, Rationale: range(3) generates numbers starting from 0 up to but not including 3. 22.Which data type is ordered and mutable? A) tuple B) set C) list D) frozenset Answer: C) list Rationale: Lists maintain order and can be modified after creation.

23.What does print(2 == 2.0) return? A) True B) False C) Error D) None Answer: A) True Rationale: Python compares numeric values across types and considers 2 equal to 2.0. 24.Which keyword is used to exit a loop? A) stop B) exit C) break D) return Answer: C) break Rationale: break terminates the loop immediately when executed. 25.What is output of 5 % 2? A) 2 B) 1 C) 0 D) 2. Answer: B) 1 Rationale: The modulus operator returns remainder after division. 26.What does not True evaluate to? A) True B) False C) None D) Error

B) print C) show D) display Answer: B) print Rationale: print() outputs data to the console. 31.What does str(100) return? A) 100 B) "100" C) 100. D) Error Answer: B) "100" Rationale: str() converts numbers to string format. 32.Which is a valid Python literal? A) True B) true C) TRUE D) yes Answer: A) True Rationale: Boolean literals in Python are case-sensitive: True and False. 33.What is output of 2 + 3 * 2? A) 10 B) 8 C) 7 D) 12 Answer: C) 8 Rationale: Multiplication has higher precedence than addition.

34.Which keyword defines loop iteration? A) for B) iterate C) loop D) each Answer: A) for Rationale: for is used for iterating over sequences. 35.What is type of {}? A) list B) tuple C) dictionary D) set Answer: C) dictionary Rationale: Empty curly braces define an empty dictionary. 36.Which function checks data type? A) check() B) type() C) isinstanceonly() D) class() Answer: B) type() Rationale: type() returns the data type of an object. 37.What is output of "a" + "b"? A) ab B) a b C) error D) a+b

B) try/except C) error D) handle Answer: B) try/except Rationale: Python uses try/except blocks to manage runtime errors. 42.What does abs(-5) return? A) - 5 B) 5 C) 0 D) error Answer: B) 5 Rationale: abs() returns the absolute (positive) value of a number. 43.What is output of min([3,1,2])? A) 3 B) 1 C) 2 D) error Answer: B) 1 Rationale: min() returns the smallest value in a sequence. 44.Which keyword creates a class? A) object B) class C) struct D) define Answer: B) class Rationale: class defines a new object blueprint in Python.

45.What is output of max([1,5,3])? A) 1 B) 3 C) 5 D) error Answer: C) 5 Rationale: max() returns the largest value in a sequence. 46.What does round(2.6) return? A) 2 B) 3 C) 2. D) error Answer: B) 3 Rationale: round() rounds to the nearest integer. 47.Which keyword is used to return value from function? A) break B) exit C) return D) yieldonly Answer: C) return Rationale: return sends a value back from a function. 48.What is output of 1 == 1 and 2 == 3? A) True B) False C) None D) Error Answer: B) False

B) append() C) insertonly() D) push() Answer: B) append() Rationale: append() adds an item at the end of a list. 53.What is output of bool("")? A) True B) False C) None D) Error Answer: B) False Rationale: Empty string is considered falsy. 54.Which keyword is used for module import? A) include B) using C) import D) require Answer: C) import Rationale: import loads external modules. 55.What is output of list("abc")? A) abc B) ['a','b','c'] C) ['abc'] D) error Answer: B) ['a','b','c'] Rationale: String is split into characters when converted to list.

56.Which operator checks identity? A) == B) is C) equals D) === Answer: B) is Rationale: is checks if two variables reference the same object. 57.What is output of 10 > 5 and 3 < 1? A) True B) False C) None D) Error Answer: B) False Rationale: Second condition is False, so AND evaluates False. 58.Which function returns length? A) size() B) len() C) length() D) count() Answer: B) len() Rationale: len() returns number of items in a container. 59.What is correct dictionary syntax? A) [a:1] B) (a:1) C) {a:1} D)

B) break C) loop D) continue Answer: C) loop Rationale: loop is not a Python keyword. 64.What does str.lower() do? A) uppercase B) lowercase C) reverse D) delete Answer: B) lowercase Rationale: Converts string to lowercase. 65.What is output of [1,2] + [3,4]? A) [1,2,3,4] B) [4,6] C) error D) [1,5] Answer: A) [1,2,3,4] Rationale: List concatenation merges lists. 66.Which statement skips iteration? A) break B) pass C) continue D) stop Answer: C) continue Rationale: continue skips current loop iteration.

67.What is output of type(True)? A) int B) bool C) str D) float Answer: B) bool Rationale: True is a boolean type. 68.Which symbol starts docstring? A) # B) // C) """ D)