PCAP-31-03 Practice Test practice questions, page 3 of 5, with answer review and explanations.
Question 11
What is the expected behavior of the following code?
it outputs error
it outputs
the code is erroneous and it will not execute
it outputs list assignment index out of range
Question 12
Which of the following expressions evaluate to True? (Choose two.)
ord("0") - ord("9") == 10
len("''") == 2
chr(ord('z') - 1) == 'y'
len(''1234'') == 4
Question 13
Which of the following expressions evaluate to True? (Choose two.)
'xYz'.lower() > 'XY'
'8'+'8' ! = 2 * '8'
float ('3.14') == str('3.' + '14')
121 + 1 == int('1' + 2 * '2')
Question 14
What is the expected behavior of the following code?
it outputs 3
it outputs 'None'
it outputs 0
it raises an exception
Question 15
What is the expected behavior of the following code? the_list = "alpha;beta;gamma".split(";") the_string = ''.join(the_list) print(the_string.isalpha())