GoConqr has a new look! Let us know what you think.

Quiz

PCAP

Mihai Cristian Tabarcea 141 questions

Take the quiz

Questions in this quiz (141)

  1. 1What will be the value of the i variable when the while e loop finishes its execution?Image for question 1
    1. A1
    2. B0
    3. C2
    4. Dthe variable becomes unavailable
  2. 2What is the expected output of the following snippet?Image for question 2
    1. A3
    2. B1
    3. C2
    4. Dthe code is erroneous
  3. 3What is true about Python class constructors? (Choose two.)
    1. Athere can be more than one constructor in a Python class
    2. Bthe constructor must return a value other than None
    3. Cthe constructor is a method named __init__
    4. Dthe constructor must have at least one parameter
  4. 4Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)Image for question 4
    1. Aisinstance (obj_b,A)
    2. BA.VarA == 1
    3. Cobj_a is obj_aa
    4. DB.VarA == 1
  5. 5Assuming that the code below has been executed successfully, which of the expressions evaluate to True? (Choose two.)Image for question 5
    1. Alen(Class.__dict__) == 1
    2. B'data' in Class.__dict__
    3. C'var' in Class.__dict__
    4. D'data' in Object.__dict__
  6. 6A property that stores information about a given class's super-classes is named:
    1. A__upper__
    2. B__super__
    3. C__ancestors__
    4. D__bases__
  7. 7Which 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.)Image for question 7
    1. Aself.queue.append(self.get_last() + 1)
    2. Bself.queue.append(get_last() + 1)
    3. Cself.queue.append(self.queue[-1] + 1)
    4. Dqueue.append(self.get_last() + 1)
  8. 8What is the expected output of the following code?Image for question 8
    1. Aa
    2. Bc
    3. Can exception is raised
    4. Db
  9. 9What is the expected output of the following code if there is no file named non_existing_file inside the working directory?Image for question 9
    1. A1 2 4
    2. B1 2 3 4
    3. C2 4
    4. D1 3
  10. 10What 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?Image for question 10
    1. Athe length of the first line from the file
    2. B-1
    3. Cthe number of lines contained inside the file
    4. Dthe length of the last line from the file

Information

Description
Quiz on PCAP, created by Mihai Cristian Tabarcea on 12/01/2026.
Language
English
Views
0
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?