[Tutor] Need to convert 1,987,087,234,456 to an int
Eric Walker
sli1que at yahoo.com
Thu Aug 16 05:23:59 CEST 2007
I am a newbie but think its for variable input. Allows you to enter any number with commas in it and still work properly. Since it thinks the number is a tuple, then depending on the number your tuple could vary in length.
Eric Walker
Dick Moores <rdm at rcblue.com> wrote: At 06:58 PM 8/15/2007, John Fouhy wrote:
>You could do this:
>
> >>> def decomma(*t):
>... return int(''.join(str(i) for i in t))
What's that asterisk doing in decomma(*t)? Where do I go in the docs
to look it up?
Thanks,
Dick
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070815/ea5bdadd/attachment.html
More information about the Tutor
mailing list