[Tutor] Function calls

orbitz orbitz at ezabel.com
Sun Nov 14 19:23:44 CET 2004


Because you are the value is not 0 it is [1,3,4,0] in the first and(1, 
0) in the second. This is a list and a tuple respectively, 0 is an integer.


kumar s wrote:

>Dear group,
> i have been practising some function examples:
>
>here is a function i wrote:
>
>
>def min3(*args):
>	tmp = list(args)
>	tmp.sort()
>	return tmp[0]
>
>  
>
>>>>min3(1,3,4,5,6,[1,3,4,0])
>>>>        
>>>>
>1
>  
>
>>>>min3(1,2,3,4,5,(1,0))
>>>>        
>>>>
>1
>
>
>Why isnt it showing '0' as the minimun value. this
>function should report min value irrespective of a
>list or a tuple passed to an argument as a call.
>
>Can any one help me understand please.
>
>thank you. 
>
>regards, 
>kumar
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Check out the new Yahoo! Front Page. 
>www.yahoo.com 
> 
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>  
>



More information about the Tutor mailing list