1
2
3
4
5
6
7
8
9
10
11
12
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to Trinket.
Post a review on Amazon for the paperback or the Kindle edition.
Email me to give me a compliment, complaint, or correction. I'll respond.
0,1,2,3,4,5,6,7,8,9,10,11
0
0
0
0
To strike an element off a list and assign it to a variable, what keyword do you use? | pop | ^ *pop *$ | |
Fill in the blank to pop the third element off the list. | popped_element = big_list.pop(__) | 2 | ^ *2 *$ |
Complete the code to pop the first element off the list. | popped_element = big_list____________ | .pop(0) | .`pop`(`0`) |
Pop the second element off the list y and assign it to the variable x. | x = y.pop(1) | x = y.pop(1) | |
Pop an element off a list and assign it to a variable. Make everything up. | x = y.pop(1) | ^ *[a-zA-Z_][a-zA-Z0-9_]* = [a-zA-Z_][a-zA-Z0-9_]*\.pop\([0-9]*\) *$ | |
Pop the first element of list y and append it to the end of list x. | x.append(y.pop(0)) | ^ *x\.append\(y\.pop\(0\)\) *$ | |
Pop the fourth element of list y and insert it as the third element of list x. | x.insert(2, y.pop(3)) | ^ *x\.insert\(2, y\.pop\(3\)\) *$ | |
Using minimal code, pop the last element off list y and assign it to the variable x. | x = y.pop() | ^ *x = y\.pop\(\) *$ | |
x equals 100 plus the sixth element popped off list y. Code it in a single statement. | x = 100 + y.pop(5) | ^ *x = 100 \+ y\.pop\(5\) *$ | |
Using the keywords append and pop, move the first element of the list x to the end of list x. | x.append(x.pop(0)) | ^ *x\.append\(x\.pop\(0\)\) *$ | |
| 482394e4dd | ||
| 8cf2eee2c2 |