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

Page 18 of 37

What is the expected output of the following snippet?

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

Answer(s): C

Explanation:



What is the expected output of the following snippet?

  1. abc
  2. The code will cause a runtime exception
  3. ABC
  4. 123

Answer(s): B

Explanation:



How many elements will the list2 list contain after execution of the following snippet? list1 = [False for i in range (1, 10) ]
list2 = list1 [-1:1:-1]

  1. zero
  2. five
  3. seven
  4. three

Answer(s): C

Explanation:



What would you use instead of XXX if you want to check whether a certain ` key' exists in a dictionary called diet? (Select two answers)
II
if XXX:
print("Key exists")

  1. 'key' in diet
  2. diet['key'] != None
  3. diet.exists('key')
  4. 'key' in diet.keys()

Answer(s): A,D






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

PCAP-31-03 Discussions & Posts