[Tutor] Updating index of a list

Andrea Nguy andrea.nguy at gmail.com
Thu Oct 8 21:40:38 CEST 2015


Hi there,

I’m trying to learn some Python programming on my own. What’s happening is that I am trying to take a list of a list as such: [['1', ' james', ' 1', ' 90'], ['2', ' alice', ' 1', ' 95'], ['5', ' jorgen', ' 1', ' 99’]] (it continues) from a text file.

However, what I am trying to do take the indexes of thelist[0][1] and theist[0][3] and times them by a float number - returning the list with all of the values multiplied according to the float.

Is this possible? I am trying to iterate that throughout the entire list or would it be easier if I tried to change the list of the list into a dictionary for efficiency?

Thanks! 



More information about the Tutor mailing list