Message92920
>>> max(['34', '7'])
'7'
>>> #This happens because it is comparing strings.
>>> #I have found a way to fix it though.
>>> def Max(li):
... greatest=li[0]
... for item in li:
... for item2 in li:
... if int(item)<int(item2) or int(item)<greatest:
... break
... else:
... greatest=int(item)
... return(greatest) |
|
Date |
User |
Action |
Args |
2009-09-21 03:03:06 | lovelygoo2 | set | recipients:
+ lovelygoo2 |
2009-09-21 03:03:05 | lovelygoo2 | set | messageid: <1253502185.93.0.333528519987.issue6955@psf.upfronthosting.co.za> |
2009-09-21 03:03:03 | lovelygoo2 | link | issue6955 messages |
2009-09-21 03:03:01 | lovelygoo2 | create | |
|