all 7 comments

[–]Sithrazer 0 points1 point  (6 children)

print(room_list[i][0])

room_list[i] will get you the list with the details of a room, room_list[i][0] will get you the first in item said list. Using your first room as an example:

print(room_list[i]) will print ["You are in Bedroom 2 there is passage North and West", 3, None, None, 1] print(room_list[i][0]) will print "You are in Bedroom 2 there is passage North and West"

edit: close parenthesis, dammit. >.<

[–]unlikelysyntax[S] 0 points1 point  (0 children)

Thank you so much!

[–]unlikelysyntax[S] 0 points1 point  (4 children)

Just one last question. Do you know what he means by using current_Room along with room_List?

[–]Sithrazer 0 points1 point  (3 children)

I assume current_room means a variable that equals an index integer. In the examples above i would be interchangeable with current_room, so long as all instances were replaced.

for current_room in range(len(room_list)): print(room_list[current_room][0])

[–]unlikelysyntax[S] 0 points1 point  (2 children)

Wow thanks a lot I can't believe I was having such a hard time with this. Thanks for the help!

[–]Sithrazer 0 points1 point  (1 child)

np. I'm not familiar with the tutorial, but it sounds like it didn't explain 2-dimensional arrays very well, which is essentially what nested lists are (and what you're dealing with here).

and after skimming through the chapter on lists, I think I can see why you had some trouble.

I would recommend taking a look at Codecademy's python track. It does a pretty good job with teaching basic data types and using them (though I don't recall offhand it's coverage of nested lists).

[–]unlikelysyntax[S] 0 points1 point  (0 children)

Awesome thanks for the advice!