[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Selecting MAX from a list

Ines T

3/5/2010 11:40:00 AM

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!

1 Answer

lbolla

3/5/2010 12:25:00 PM

0

On Mar 5, 11:39 am, Ines T <azt...@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!