0

List

number = 3 things = ["string", 0, [1, 2, number], 4.56] print(things[1]) print(things[2]) print(things[2][2]) OUTPUT 0 [1, 2, 3] 3 How and why output ? =3

20th Mar 2020, 3:00 AM
Pratyaksh Raj Singh
Pratyaksh Raj Singh - avatar
1 Resposta
+ 2
At things[2] there is a list So things[2] == [1,2,number] Where number == 3 and Let lst = things[2] Then lst == [1,2,3] and. lst[2] == 3 Then things[2][2] == 3
20th Mar 2020, 3:11 AM
Utkarsh Sharma
Utkarsh Sharma - avatar