PCAP Sample Questions

PCAP Sample Questions & Answers

Explores object-oriented programming in Python, by far the biggest weight, plus list comprehension, lambda functions and closures, built-in string methods and character representation, handling and extending exceptions, and importing modules and packages.

Launch the full PCAP simulator →

Showing 10 of 20 free samples.

  1. Question 1

    A method for passing the arguments used by the following snippet is called:

    PCAP sample question 1
    Show answer & explanation
  2. Question 2Select 2

    You need data which can act as a simple telephone directory. You can obtain it with the following clauses (Select two relevant variants; assume that no other items have been created before)

    Show answer & explanation

    Correct answers: C, D

    C, D

    C, D

  3. Question 3Select 2

    A class constructor (Select two answers)

    Show answer & explanation

    Correct answers: A, D

    A, D

    A, D

  4. Question 4

    If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

    Show answer & explanation
  5. Question 5

    What is the expected output of the following snippet?

    PCAP sample question 5
    Show answer & explanation

    Correct answer: A

    A

  6. Question 6

    A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:

    Show answer & explanation

    Correct answer: D

    D

  7. Question 7

    The following class hierarchy is given. What is the expected out of the code?

    PCAP sample question 7
    Show answer & explanation

    Correct answer: D

    D

  8. Question 8Select 2

    If you need a function that does nothing, what would you use instead of XXX? (Select two answers)

    PCAP sample question 8
    Show answer & explanation
  9. Question 9

    Is it possible to safely check if a class/object has a certain attribute?

    Show answer & explanation
  10. Question 10

    The following expression

    is:

    PCAP sample question 10
    Show answer & explanation

    Correct answer: D

    D

Ready for the real thing?

The full PCAP simulator has every exam-style question, timed mode, and instant scoring.

Go to the PCAP simulator →