Free PCAP-31-03 Exam Braindumps
Certified Associate in Python Programming Exam Questions 31–35 (page: 8)

Updated On: 9-Feb-2026

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

  1. open () requires a second argument
  2. open () is a function which returns an object that represents a physical file
  3. instd, outstd, errstd are the names of pre-opened streams
  4. if invoking open () fails, an exception is raised

Answer(s): B,D



What is the expected behavior of the following code? x = 8 ** (1/3)
y = 2. if x < 2.3 else 3.
print(y)

  1. it outputs 2.0
  2. it outputs 2. 5
  3. the code is erroneus and it will not execute
  4. it outputs 3.0

Answer(s): A



What is the expected output of the following code?
def foo(x,y,z):
return x(y) - x(z)
print{f00(lambda x: x % 2, 2, 1) )

  1. 1
  2. 0
  3. -1
  4. an exception is raised

Answer(s): C



Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

  1. a is b
  2. b( ) > 2
  3. a() > 2
  4. a is not None

Answer(s): B,C,D



What is the expected output of the following code?

  1. 4
  2. 16
  3. an exception is raised
  4. 1

Answer(s): D



Viewing page 8 of 30
Viewing questions 36 - 40 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!