newbie seeks advise.

Gerhard Häring gerhard.haering at
Fri Sep 20 01:50:09 EDT 2002

* akirasugiura <kodokuchef at> [2002-09-19 22:37 -0700]:
> Hi,
> I've been learning python for about a month. I had no prior knowledge
> of programming.
> My question is, I have a tuple which is, data = (69, 40, 74, 41, 56,
> 57, 38, 58, 26, 55). How I can make a function that picks up a largest
> number from this "data" tuple. If "data" was a  'List' I would be able
> to use "sort" but since sort doesn't  work with tuple. I am stuck
> here.


Now that was too simple, wasn't it?

If you want to program a max() function yourself, you can convert the
tuple to a list using list(data), then sorting it, then finding the
largest element yourself.

-- Gerhard

More information about the Python-list mailing list