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
Which is the attribute in the following code? | class Patient(): def __init__(self, name): |
name | ^ *name *$ |
Fill in the blank at the beginning of the line. | ____ __init__(self, name): | def | ^ *def *$ |
Complete the line. The attribute is name. | def __init__(____________ | self, name): | self`, `name`)`: |
Type the two characters that come immediately before and immediately after init. | __ | __ | |
Type the word that has two underlines before and two underlines after it. | init | ^ *init *$ | |
Type the word that begins the second line of a class definition. | def | ^ *def *$ | |
Type all the characters that come before the opening parenthesis in the definition of an attribute. | def __init__ | ^ *def __init__ *$ | |
Type all the characters up to and including the comma. | def __init__(self, | ^ *def __init__\(self, *$ | |
Code the second line of a class definition. Make up the attribute name. No need to indent. | def __init__(self, age): | ^ *def __init__\(self, [a-zA-Z_][a-zA-Z0-9_]*\): *$ | |
Code the first two lines of a class definition. Make up the names. Remember to capitalize the class name and to indent the second line. | class House(): def __init__(self, price): |
^ *class [A-Z][a-zA-Z0-9_]*\(\):\n def __init__\(self, [a-zA-Z_][a-zA-Z0-9_]*\): *$ | |
|
0bf8a86f54 | ||
|
8ab88f2a7f |