Sample questions
Certified Entry-Level Python Programmer PCEP practice questions
Which TWO of the following exceptions are built-in Python exceptions? (Select exactly 2)
Functions, Tuples, Dictionaries and ExceptionseasySee the answer and why each option is right or wrong →A developer wants to read a floating-point number from user input and compute its square. Which code snippet correctly accomplishes this?
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →Which TWO of the following expressions evaluate to True in Python? (Choose two.)
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →What is the output when the following code is executed? try: print(1/0) except ZeroDivisionError: print("Cannot divide by zero")
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →A function is defined as: def min_max(nums): return min(nums), max(nums). What type of value does it return?
Functions, Tuples, Dictionaries and ExceptionsmediumSee the answer and why each option is right or wrong →A developer needs to implement a loop that prints numbers from 10 down to 1. Which loop correctly achieves this?
Refer to the exhibit. What is the output?
Functions, Tuples, Dictionaries and ExceptionsmediumSee the answer and why each option is right or wrong →Arrange the steps to install a third-party Python package using pip.
Which loop is more efficient for iterating over a large list when you only need the values, not indices?
Refer to the exhibit. What type of error occurred, and which line caused it?
Computer Programming and Python FundamentalsmediumSee the answer and why each option is right or wrong →A company uses a for loop to iterate over a list of transaction amounts. They want to skip negative amounts. Which statement inside the loop correctly achieves this?
You are a developer in a financial firm. Your team is building a Python module that performs complex calculations on large datasets. To improve performance, you are using list comp…
Computer Programming and Python FundamentalshardSee the answer and why each option is right or wrong →Which THREE of the following expressions evaluate to the integer 1? (Select three.)
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →Refer to the exhibit. What is the output of the code?
What is the output of the code? numbers = [1, 2, 3, 4] result = [x**2 for x in numbers if x % 2 == 0] print(result)
What is the output of the code in the exhibit?
Computer Programming and Python FundamentalsmediumSee the answer and why each option is right or wrong →A programmer writes: result = 'Py' * 2 + 'thon'. What is the value of result?
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →Which of the following expressions evaluates to False?
Data Types, Variables, Basic I/O and OperatorseasySee the answer and why each option is right or wrong →Order the steps to write a for loop that iterates over a range of numbers.
Data Types, Variables, Basic I/O and OperatorsmediumSee the answer and why each option is right or wrong →Match each Python concept to its description.
Which TWO of the following are valid variable names in Python? (Choose two.)
Data Types, Variables, Basic I/O and OperatorseasySee the answer and why each option is right or wrong →Which TWO of the following are valid Python data types?
Data Types, Variables, Basic I/O and OperatorseasySee the answer and why each option is right or wrong →A function is defined as: def add(a, b=5): return a + b What is the result of add(10)?
Computer Programming and Python FundamentalsmediumSee the answer and why each option is right or wrong →