Free PCAP-31-03 Exam Braindumps (page: 14)

Page 13 of 37

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



What is the expected output of the following code?

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

Answer(s): A



Which of the following lambda definitions are correct? (Select two answers)

  1. lanbda x, y; return x\\y - x%y
  2. lambda x, y: x//y - x%y
  3. lambda (x, y = x\\y x%y
  4. lambda x, y: (x, y)

Answer(s): B,D






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

PCAP-31-03 Discussions & Posts