cjxsam
June 13, 2024, 11:03am
1
Hi would anyone mind helping me with this lesson, I am up to stage 2 of this lesson
URL: https://www.codecademy.com/courses/learn-python-3/lessons/create-python-list/exercises/accessing-2-d-lists
CODE: `#Your code below:
class_name_test = [[“Jenny”, 90], [“Alexus”, 85.5], [“Sam”, 83], [“Ellie”, 101.5]]
sams_score = score[0][1]
print(sams_score)`
Thanks if you can help me
Close.
What is the index of the sublist that contains Sam’s info? (Remember to start at 0).
1 Like
sams_score = score[0][1] gives you 90 because you are pointing to the first element of the outer array wich Is [“Jenny”, 90]
sams_score = score[2][1] should give you the right answer.
I was attempting to help them and let them think it through to arrive at the answer, rather than just giving them the answer…
1 Like
You are right about It I should avoid the straight answers but I think he got the point of It.
Sorry for that
1 Like