Prev: [ANN] pysqlite 2.6.0 released
Next: Proper way to return an instance of a class from a class method ?
From: Ines T on 5 Mar 2010 06:39 I need to select a maximum number from a list and then call the variable that identifies that number, for example: x1,x2=1, y1,y2=4, z1,z2=3 So I need first to find 4 and then to take y to do additional operations as y-z. I will appreciate your SOON help!
From: lbolla on 5 Mar 2010 07:24
On Mar 5, 11:39 am, Ines T <azt...(a)gmail.com> wrote: > I need to select a maximum number from a list and then call the variable that > identifies that number, for example: > x1,x2=1, y1,y2=4, z1,z2=3 > So I need first to find 4 and then to take y to do additional operations as y-z. It's not clear what you are supposed to do, but wouldn't a combination of "max" and "index" do? x = [3,2,1,4,5,2,3] max(x) # 5 x.index(5) # 4 > I will appreciate your SOON help! And, by the way, politeness is free! |