PCAP Practice Test practice questions, page 4 of 6, with answer review and explanations.
Question 16
What is the expected output of the following snippet?
1
4
2
3
Question 17
What is the expected output of the following snippet?
abc
The code will cause a runtime exception
ABC
123
Question 18
How many elements will the list2 list contain after execution of the following snippet?
zero
five
seven
three
Question 19
What would you used instead of XXX if you want to check weather a certain 'key' exists in a dictionary called dict? (Choose two.)
'key' in dict
dict ['key'] != None
dict.exists ('key')
'key' in dict.keys ( )
Question 20
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (Choose two.) (assume that no other items have been created before)