Free PCAP-31-03 Exam Braindumps
Certified Associate in Python Programming Exam Questions 46–50 (page: 11)

Updated On: 9-Feb-2026

What is a true about python class constructors? (Select two answers)

  1. the constructor must have at least one parameter
  2. the constructor must return a value other than None
  3. the constructor is a method named_init_
  4. there can the more than one constructor in a Python class.

Answer(s): A,C



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, 1] ? (Select two answers)

  1. put self.store(1])
  2. self put stire(1])
  3. self .put self.get () [-1])
  4. self .put (self.store[1])

Answer(s): B,D



What is the expected behavior of the following code? x - 3 % 1
y -1 if x > else 0
print (y)

  1. it outputs -1
  2. the code is erroneous and it will not execute
  3. it outputs 1
  4. it outputs 0

Answer(s): D



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

  1. 2 2
  2. 1 3
  3. 1 2 3
  4. 2 2 3

Answer(s): B



Which of the following statement are true? (Select two answers)

  1. closing an open file is performed by the closefile ( ) function
  2. the second open ( ) argument describes the open mode and defaults to `w'
  3. if open ( ) `s second argument is `r' the file must exist or open will fail
  4. if open ( )'s second argument is `w' and the invocation succeeds, the previous file's content is lost

Answer(s): C,D



Viewing page 11 of 30
Viewing questions 51 - 55 out of 147 questions


Post your Comments and Discuss Python Institute PCAP-31-03 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!