0
N3 - Mistake
number = 3 things = ["string", 0, [1, 2, number], 4.56] print(things[1]) print(things[2]) print(things[2][2]) Result: >>> 0 [1, 2, 3] 3 >>> things[2][2] is number not 3 :)))
2 Antworten
+ 1
number is a variable. number = 3. when the print statement evaluates the variable number, it prints 3, so 3 is correct.
if your list were as follows: things = ["string", 0, [1, 2, 'number'], 4.56]
then the output would be 'number'. If you are interested, try running this code in the code playground, IDLE or a python interpreter. Step through the code as it is running and inspect the variables. That will help you see what is going on.
0
3 it's correct since you've assigned that value to the number variable