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
In the following code, 0 is the name of a _________. | customers = { 0: [ |
list | ^ *list *$ |
In the following code, 0 is the name of a _________. | customers = { 0: { |
dictionary | ^ *dictionary *$ |
The first pair in the 0 dictionary is "first name" and "John". Fill in the blank. Remember to end the line with a comma. | customers = { 0: { _________________ | "first name": "John", | "`first name`"`: `"`John`"`, |
Code the next line. The dictionary name is 0. Remember to indent. | customers = { | 0: { | 0: { |
Code the first two lines of a dictionary within a dictionary. The inner dictionary name is 0. Make up the name of the outer dictionary. Remember to indent the second line. | products = { 0: { |
^ *[a-zA-Z_][a-zA-Z0-9_]* = {\n 0: { *$ | |
The first pair in the 0 dictionary is "wrench" and 9.37. Code the line. Remember to double-indent it and to end the line with a comma. | products = { 0: { |
"wrench": 9.37, | ^ * •wrench•: 9\.37, *$ |
The next pair is "saw" and 23.47. Code the line, then close the 0 dictionary. Pay attention to the indents. End both lines with a comma. | products = { 0: { "wrench": 9.37, |
"saw": 23.47, }, |
^ * •saw•: 23\.47,\n }, *$ |
Code the first two lines of a dictionary that includes an inner dictionary. The name of the outer dictionary is a variable. The name of the inner dictionary is an integer. Make everything up. | ranking_nations = { 99: { |
^ *[a-zA-Z_][a-zA-Z0-9_]* = {\n -?[0-9]+: { *$ | |
Code a complete dictionary that includes nothing but one inner dictionary. The name of the outer dictionary is a variable. The name of the inner dictionary is an integer. The inner dictionary contains only one pair, a string key and a string value. Make everything up. | x = { 0: { "name": "Ortiz", }, } |
^ *[a-zA-Z_][a-zA-Z0-9_]* = {\n -?[0-9]+: {\n •.+•: •.+•,\n },\n} *$ | |
Add a second inner dictionary, then close both the inner and outer dictionaries. The dictionary's name is 1. It contains just one pair. Its key is "name". Make up the value, a string. | x = { 0: { "name": "Ortiz", }, |
1: { "name": "Ng", }, } |
^ * 1: {\n •name•: •.+•,\n },\n} *$ |
|
bbb26c2330 | ||
|
bc8b92ea8e |