Which of the following lambda definitions are correct? (Choose two.)
- A. lambda(x,y) = x//y - x%y
- B. lambda x,y: return x//y - x%y
- C. lambda x,y: (x,y)
- D. lambda x,y: x//y - x%y
Show Answer
- C. lambda x,y: (x,y)
- D. lambda x,y: x//y - x%y
Certified Associate in Python Programming (PCAP-31-03) is a associate-level Python Institute certification exam. The blueprint splits the exam across 5 domains, starting with Python Essentials, Data Structures, OOP. On exam day you face around 40 questions in 65 minutes, in formats such as multiple-choice. The 15 questions below are free samples written to match that style: answer each one first, then reveal the correct answer and note which topics you miss. The PCAP-31-03 is rated medium in difficulty, and most candidates prepare with at least 6 months of hands-on experience. Because every answer is revealed in place, you can work through the whole set without leaving this page. Work through all 15 samples before deciding whether to buy the full 57+ question PDF.
Looking for more? Click here to get the full PDF with 57+ practice questions for $10 for offline study and deeper preparation.
Which of the following lambda definitions are correct? (Choose two.)
A Python module named pymod.py contains a variable named pyvar. Which of the following snippets will let you access this variable? (Choose two.)
What is true about Object-Oriented Programming in Python? (Choose two.)
What is true about Python packages? (Choose two.)
What is the expected output of the following code? import sys import math b1 = type(dir(math)[0]) is str b2 = type(sys.path[-1]) is str print(b1 and b2)
A Python package named pypack includes a module named pymod.py which contains a function named pyfun(). Which of the following snippets will let you invoke the function? (Choose two.)
Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Choose two.)
What is true about Python class constructors? (Choose two.)
What is the expected output of the following code? import sys import math b1 = type(dir(math)) is list b2 = type(sys.path) is list print(b1 and b2)
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'REPTILE'[:3:] string = string[-1] + string[-2::-1]
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'python'[::2] string = string[-1] + string[-2]
What is the expected output of the following code? import sys b1 type (dir(sys)) is str b2 type (sys.path[-1]) is str print (b1 and b2)
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'SKY'[::-1] string = string[-1]
Which of the following expressions evaluate to True? (Choose two.)
What is true about lambda functions? (Choose two.)
No. They are original practice questions written to match the format and topic mix of the Certified Associate in Python Programming exam, which contains around 40 questions. Treat them as representative practice, not leaked exam content.
This page includes 15 questions, each with its correct answer you can reveal in place. The full study PDF expands that to 57+ questions.
Yes. Open the answer panel under each question to see which option is correct. Answer first, then reveal, so the set works as a self-check rather than a reading exercise.
Not on its own. Use the samples to find weak topics, revise them against the official domains, then work through the full 57+ question set under timed conditions before booking the exam.
Download the complete PCAP-31-03 study bundle with 57+ questions in a single printable PDF.
Start typing to search exams
Access practice tests for AWS, Microsoft, Cisco and more.