PCAP-31-03 Practice Test

PCAP-31-03 Practice Test practice questions, page 4 of 5, with answer review and explanations.

Question 16

Which of the following invocations are valid? (Choose two.)

  1. sort("python")
  2. "python".find("")
  3. "python".sort()
  4. sorted("python")

Question 17

Which of the following expressions evaluate to True? (Choose two.)

  1. 'in' in 'in'
  2. 'in' in 'Thames'
  3. 'in not' in 'not'
  4. 't'.upper() in 'Thames'

Question 18

Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'python'[::2] string = string[-1] + string[-2]

  1. len(string) == 3
  2. string[0] == 'o'
  3. string[0] == string[-1]
  4. string is None

Question 19

Which of the following statements are true? (Choose two.)

  1. an escape sequence can be recognized by the / sign put in front of it
  2. ASCII is a subset of UNICODE
  3. II in ASCII stands for Internal Information
  4. a code point is a number assigned to a given character

Question 20

A property that stores information about a given class’s super-classes is named:

  1. __bases__
  2. __super__
  3. __upper__
  4. __ancestors__