[EMAIL PROTECTED] wrote: > i have declared a function like this: > > def aFunction ( arg1 , arg2 = 0): > .... > print type(arg2) > > when i try to print the type of arg2, it gives me 'str' type..why is it > not integer type, since i have declared it as 0 ??
because you or someone else is passing in a string as the second argument, perhaps? >>> def aFunction(arg1, arg2=0): ... print type(arg2) ... >>> aFunction(1) <type 'int'> >>> aFunction(1, 2.0) <type 'float'> >>> aFunction(1, "two") <type 'str'> </F> -- http://mail.python.org/mailman/listinfo/python-list