Python Institute PCAP-31-03 Exam
Certified Associate in Python Programming Exam (Page 4 )

Updated On: 12-Jan-2026

The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns.
Which of the invocations should be used instead of XXX?

  1. print (get(self))
  2. print (self.get())
  3. print (get())
  4. print (self.get (val))

Answer(s): B



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

  1. sequential
  2. named
  3. positional
  4. keyword

Answer(s): C



If you want to transform a string into a list of words, what invocation would you use? (Select two answers)
Expected output:

  1. s.split ()
  2. split (s, "~ "~)
  3. s.split ("~ "~)
  4. split (s)

Answer(s): A,C



You are going to read 16 bytes from a binary file into a bytearray called dat

  1. Which lines would you use? (Select two answers)
  2. data = bytearray (16) bf.readinto (data)
  3. data = binfile.read (bytearray (16))
  4. bf. readinto (data = bytearray (16))
  5. data = bytearray (binfile.read (16))

Answer(s): A,D

Explanation:

https://docs.python.org/3/library/functions.html#func-bytearray https://docs.python.org/3/library/io.html



Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers)

Expected output:
1 2 3
Code:

  1. c, b, a = b, a, c
  2. c, b, a = a, c, b
  3. a, b, c = c, a, b
  4. a, b, c = a, b, c

Answer(s): A,C



Viewing page 4 of 30
Viewing questions 16 - 20 out of 147 questions



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

Join the PCAP-31-03 Discussion