CMN 152V EVALUATION TEST QUESTIONS AND
ANSWERS SURE A+
✔✔list_edits6 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.append(0)
pass1.append(1)
pass1 == pass2
True
False
No output - ✔✔false
✔✔list_edits7 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.append(1)
pass1.append(0)
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits8 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0]
pass1.extend( [1, 0] )
pass1 == pass2
pass2.extend( [1,0] )
True
False
No output - ✔✔no output
,✔✔list_edits9 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.extend( [1, 0] )
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits10 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0]
pass1.insert(0, 0)
pass1.insert(0, 1)
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits11 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.insert(5, 0)
pass1.insert(5, 1)
pass1 == pass2
True
False
No output - ✔✔false
✔✔list_edits12 — try itWhat list results from the code below?
[3, 4, 5] + 1
1. [3, 4, 5, 1]
2. [4, 5, 6]
3. Error - ✔✔error
✔✔growing_lists1 — try it
What is the output of the code block below?
testList = [1,1]
testList2 = testList
testList2.extend( [] )
testList2.extend( [] )
testList == testList2 - ✔✔true
✔✔growing_lists2 — try it
What is the output of the code block below?
, testList = [1,1]
testList.extend( [] )
testList == [] - ✔✔false
✔✔growing_lists3 — try it
What is the value of groceryList?
groceryList = []
groceryList.extend( ['apples', 'butter'] )
groceryList.append( ['bread'] )
groceryList.append( ['dishsoap'] )
['dishsoap', 'bread', 'apples', 'butter']
[ [], 'dishsoap', 'bread', 'butter', 'apples']
['apples', 'butter', ['bread'], ['dishsoap']]
[ [], 'apples', 'butter', 'bread', 'dishsoap'] - ✔✔['apples', 'butter', ['bread'], ['dishsoap']]
✔✔growing_lists4 — try it
Which option is equal to the list [2, 3, 4] ?
sequence = [-1, 0, 1, 2, 3, 4]
sequence[2] + sequence[3] + sequence[4]
sequence[3] + sequence[4] + sequence[5]
sequence[3:6]
sequence[2:6] - ✔✔sequence[3:6]
✔✔list_addition1 — try it
What is the output of the code below?
p1 = ['building a better']
p2 = ['mousetrap']
p1 + p2
'building a better mousetrap'
'building a bettermousetrap'
['building', 'a', 'better', 'mousetrap']
['building a better'], 'mousetrap'
['building a better mousetrap']
['building a better', 'mousetrap'] - ✔✔['building a better', 'mousetrap']
✔✔list_addition2 — try itWhat is the output of the code below?
p1 = [1, 2]
p2 = [2, 3]
p2 + p1
[1, 2, 3]
[1, 2, 2, 3]
[3, 2, 2, 1]
[2, 3, 1, 2]
ANSWERS SURE A+
✔✔list_edits6 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.append(0)
pass1.append(1)
pass1 == pass2
True
False
No output - ✔✔false
✔✔list_edits7 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.append(1)
pass1.append(0)
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits8 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0]
pass1.extend( [1, 0] )
pass1 == pass2
pass2.extend( [1,0] )
True
False
No output - ✔✔no output
,✔✔list_edits9 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.extend( [1, 0] )
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits10 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0]
pass1.insert(0, 0)
pass1.insert(0, 1)
pass1 == pass2
True
False
No output - ✔✔true
✔✔list_edits11 — try itWhat is the output of the code below?
pass1 = [1, 0, 1, 0, 1, 0]
pass2 = [1, 0, 1, 0, 1, 0, 1, 0] pass1.insert(5, 0)
pass1.insert(5, 1)
pass1 == pass2
True
False
No output - ✔✔false
✔✔list_edits12 — try itWhat list results from the code below?
[3, 4, 5] + 1
1. [3, 4, 5, 1]
2. [4, 5, 6]
3. Error - ✔✔error
✔✔growing_lists1 — try it
What is the output of the code block below?
testList = [1,1]
testList2 = testList
testList2.extend( [] )
testList2.extend( [] )
testList == testList2 - ✔✔true
✔✔growing_lists2 — try it
What is the output of the code block below?
, testList = [1,1]
testList.extend( [] )
testList == [] - ✔✔false
✔✔growing_lists3 — try it
What is the value of groceryList?
groceryList = []
groceryList.extend( ['apples', 'butter'] )
groceryList.append( ['bread'] )
groceryList.append( ['dishsoap'] )
['dishsoap', 'bread', 'apples', 'butter']
[ [], 'dishsoap', 'bread', 'butter', 'apples']
['apples', 'butter', ['bread'], ['dishsoap']]
[ [], 'apples', 'butter', 'bread', 'dishsoap'] - ✔✔['apples', 'butter', ['bread'], ['dishsoap']]
✔✔growing_lists4 — try it
Which option is equal to the list [2, 3, 4] ?
sequence = [-1, 0, 1, 2, 3, 4]
sequence[2] + sequence[3] + sequence[4]
sequence[3] + sequence[4] + sequence[5]
sequence[3:6]
sequence[2:6] - ✔✔sequence[3:6]
✔✔list_addition1 — try it
What is the output of the code below?
p1 = ['building a better']
p2 = ['mousetrap']
p1 + p2
'building a better mousetrap'
'building a bettermousetrap'
['building', 'a', 'better', 'mousetrap']
['building a better'], 'mousetrap'
['building a better mousetrap']
['building a better', 'mousetrap'] - ✔✔['building a better', 'mousetrap']
✔✔list_addition2 — try itWhat is the output of the code below?
p1 = [1, 2]
p2 = [2, 3]
p2 + p1
[1, 2, 3]
[1, 2, 2, 3]
[3, 2, 2, 1]
[2, 3, 1, 2]