Python-institute

PCAP practice test

Practice with 15 free Testara sample questions, or choose paid access to the full 124-question bank.

Provider
Python-institute
Question bank
124
Free sample
15 questions
Publisher
Testara

About this practice material

This page covers Testara's practice question bank for PCAP, a certification listed under Python-institute. Questions use original, exam-style scenarios and are not questions from the official certification exam.

Testara is an independent practice platform and is not affiliated with, endorsed by, or authorized by Python-institute. The certification credential is issued by Python-institute, not Testara. Certification and provider names belong to their respective owners.

Start practicing

The guest demo does not save an attempt. Sign in before buying access.

Try 15 questions free

Available without signing in

Free sample questions

These 15 questions and their explanations are server-rendered so you can inspect the material before opening the interactive demo.

  1. Question 1 · 1

    What will be the value of the i variable when the while e loop finishes its execution?

    Choose one answer.

    Question illustration 1
    • 1
    • 0
    • 2
    • the variable becomes unavailable
  2. Question 2 · 1

    What is the expected output of the following snippet?

    Choose one answer.

    Question illustration 1
    • 3
    • 1
    • 2
    • the code is erroneous
  3. Question 3 · 1

    What is true about Python class constructors? (Choose two.)

    Choose all answers that apply.

    • there can be more than one constructor in a Python class
    • the constructor must return a value other than None
    • the constructor is a method named __init__
    • the constructor must have at least one parameter
  4. Question 4 · 1

    Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • isinstance (obj_b,A)
    • A.VarA == 1
    • obj_a is obj_aa
    • B.VarA == 1
  5. Question 5 · 1

    Assuming that the code below has been executed successfully, which of the expressions evaluate to True? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • len(Class.__dict__) == 1
    • 'data' in Class.__dict__
    • 'var' in Class.__dict__
    • 'data' in Object.__dict__
  6. Question 6 · 1

    A property that stores information about a given class's super-classes is named:

    Choose one answer.

    • __upper__
    • __super__
    • __ancestors__
    • __bases__
  7. Question 7 · 1

    Which of the following lines of code will work flawlessly when put independently inside the add_new() method in order to make the snippet's output equal to [0, 1, 2]? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • self.queue.append(self.get_last() + 1)
    • self.queue.append(get_last() + 1)
    • self.queue.append(self.queue[-1] + 1)
    • queue.append(self.get_last() + 1)
  8. Question 8 · 1

    What is the expected output of the following code?

    Choose one answer.

    Question illustration 1
    • a
    • c
    • an exception is raised
    • b
  9. Question 9 · 1

    What is the expected output of the following code if there is no file named non_existing_file inside the working directory?

    Choose one answer.

    Question illustration 1
    • 1 2 4
    • 1 2 3 4
    • 2 4
    • 1 3
  10. Question 10 · 1

    What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

    Choose one answer.

    Question illustration 1
    • the length of the first line from the file
    • -1
    • the number of lines contained inside the file
    • the length of the last line from the file
  11. Question 11 · 1

    What is the expected behavior of the following code?

    Choose one answer.

    Question illustration 1
    • it outputs [1, 3]
    • the code is erroneous and it will not execute
    • it outputs [3, 1]
    • it outputs [4, 2, 0]
  12. Question 12 · 1

    Assuming that the following code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • b() == 4
    • a != b
    • a is not None
    • a() == 4
  13. Question 13 · 1

    Assuming that the following snippet has been successfully executed, which of the equations are True? (Choose two.)

    Choose all answers that apply.

    Question illustration 1
    • len(a) == len (b)
    • b [0] +1 ==a [0]
    • a [0] == b [0]
    • a [0] + 1 ==b [0]
  14. Question 14 · 1

    What is the expected output of the following code?

    Choose one answer.

    Question illustration 1
    • 3
    • 5
    • 4
    • an exception is raised
  15. Question 15 · 1

    Which of the following lambda definitions are correct? (Choose two.)

    Choose all answers that apply.

    • lambda x,y: (x,y)
    • lambda x,y: return x//y - x%y
    • lambda x,y: x//y - x%y
    • lambda x,y = x//y - x%y

Each purchase applies to this certification. Prices are one-time payments, not monthly subscriptions.

Starter

$29 USD one time

Full access to one certification's question bank in standard practice mode for 60 days.

  • Full question bank for one certification
  • 60 days of access
  • Standard practice mode
  • Question notes and community discussions
  • Attempt scores and answer review

Professional

$49 USD one time

Full access to one certification's question bank, custom test controls and advanced analytics for 60 days.

  • Custom test builder
  • Timers and question selection
  • Randomized question and answer order
  • Advanced performance and weak-question analytics
  • Priority customer support
Try 15 questions free