Monday, 26 August 2013

Python- Access item in a list of lists

Python- Access item in a list of lists

Pretty new to Python-
If I have a list of lists and just want to manipulate an individual item
in that list, how would I go about doing that?
Ex:
List1 = [[10,13,17],[3,5,1],[13,11,12]]
What if I want to take a value (say 50) and look just at the first sublist
in List1, and subtract 10 (the first value), then add 13, then subtract
17?
Thanks so much.

No comments:

Post a Comment