[Tutor] same ol s

Chad Crabtree flaxeater at yahoo.com
Thu Aug 12 00:42:10 CEST 2004


jason hochstein wrote:

> I am still having problems getting the median and mode of a list.
Any 
> ideas?? I am confused on how you tell the code to decipher from a
list 
> with an even or odd amount of numbers in it. The mode is totally 
> eluding me.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>  
>
Show us some code.  uhmmm

modulus operator is % so

if len(list)%2==0:
    print "it's even"




		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


More information about the Tutor mailing list