How do you call a function several times in this context??

Joel Goldstick joel.goldstick at gmail.com
Sun Jan 6 17:01:21 EST 2013


On Sun, Jan 6, 2013 at 4:33 PM, Jason Friedman <jason at powerpull.net> wrote:

> > def double(value):
> >         result
> >         return result
> >
> > number=input('type a number')
> > print (double(int(number)))
> >
>
> I think what was meant:
>
> def double(value):
>     result = 2 * value
>     return result
> --
> http://mail.python.org/mailman/listinfo/python-list
>

#get the string of numbers outside your function:

is_even
number = input("type an integer')

#Here is some code to loop through each digit

for n in number:
    is_even_digit(n)  # this function should test the number and print what
you want for odd and even

#This will pass each digit to your function.  I renamed your function to
reflect better python naming conventions



-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130106/ae701ca6/attachment.html>


More information about the Python-list mailing list