Re: [Tutor] Updating index of a list

2015-10-09 Thread Anshu Kumar
Hi Andrea, You can use lambda or list comprehension to solve your problem in one step. I am more comfortable with lambda so will explain that way. Please follow below lines of code. andreea_list = [['1', ' james', ' 1', ' 90'], ['2', ' alice', ' 1', ' 95'], ['5', ' jorgen', ' 1', '99']] andrea

Re: [Tutor] Updating index of a list

2015-10-08 Thread Alan Gauld
On 08/10/15 23:17, Alan Gauld wrote: On 08/10/15 20:40, Andrea Nguy wrote: 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. When you say from

Re: [Tutor] Updating index of a list

2015-10-08 Thread Steven D'Aprano
Hi Andrea, and welcome. My responses inline, below. On Thu, Oct 08, 2015 at 03:40:38PM -0400, Andrea Nguy wrote: > 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'], ['

Re: [Tutor] Updating index of a list

2015-10-08 Thread Alan Gauld
On 08/10/15 20:40, Andrea Nguy wrote: 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. When you say from a text file, do you mean you are readin

Re: [Tutor] Updating index of a list

2015-10-08 Thread Emile van Sebille
On 10/8/2015 12:40 PM, Andrea Nguy wrote: 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

[Tutor] Updating index of a list

2015-10-08 Thread Andrea Nguy
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 t