Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:How': 0.09; 'python': 0.09; 'function:': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; '#this': 0.16; 'naming': 0.16; 'renamed': 0.16; 'subject:several': 0.16; 'string': 0.17; 'wrote:': 0.17; 'odd': 0.17; 'jan': 0.18; 'cc:2**0': 0.23; '>': 0.23; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'reflect': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; 'url:mailman': 0.29; 'function': 0.30; 'code': 0.31; 'url:python': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'received:74.125.82': 0.33; 'conventions': 0.33; 'function.': 0.33; 'received:google.com': 0.34; 'jason': 0.35; 'pm,': 0.35; 'received:74.125': 0.36; 'url:org': 0.36; 'test': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'some': 0.38; 'header:Received:5': 0.40; 'url:mail': 0.40; 'think': 0.40; 'your': 0.60; 'skip:n 10': 0.63; 'number:': 0.65; 'subject:this': 0.84; '2013': 0.84; 'subject:times': 0.84; 'subject:you': 0.88; 'joel': 0.91; 'to:none': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=UwPWApZgpsC+a0YrgIGfNshcDpBu0318jSr8z5/M7OY=; b=plpBKPtXjw83vHj0BsglAXdurAo5Pb9PKP5OK1wsla1NCPZ7on3U+PbU0AWk+6kTto PLHcBdfC0Zxa2+YOWpN5XZcBjzcEK4kQT/fezH7lSfmjHVcepsQYZgAHZKr0KaolOx2g 3bSZu2/vRRszz2y70I1YzQONUzvNe73KM+PXM+Wo8xb/dma2YncV7aqVq0PvKiaRS2TB k1r2z+i5imSlyg2Dq1vAYGXsBo8q1zIfhQEhTCZzYrfA1IqXfDhjUyiuOZUNJ1Z8VjT/ 9tqStVCeVL4FP3t0akyULuRxDCLuYRwCXGBLgOXI2wqJ33MjbxWIRWRPngFwXJ5v26YV cTVQ== MIME-Version: 1.0 In-Reply-To: References: <76529b4c-fbc7-4d6d-89a5-160545448ff2@googlegroups.com> Date: Sun, 6 Jan 2013 17:01:21 -0500 Subject: Re: How do you call a function several times in this context?? From: Joel Goldstick Cc: "python-list@python.org" Content-Type: multipart/alternative; boundary=f46d044304f861f1d004d2a5da62 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 84 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357509683 news.xs4all.nl 6917 [2001:888:2000:d::a6]:49265 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36291 --f46d044304f861f1d004d2a5da62 Content-Type: text/plain; charset=UTF-8 On Sun, Jan 6, 2013 at 4:33 PM, Jason Friedman 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 --f46d044304f861f1d004d2a5da62 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Sun, Jan 6, 2013 at 4:33 PM, Jason Friedman &l= t;jason@powerpull.= net> wrote:
> def double(value): > =C2=A0 =C2=A0 =C2=A0 =C2=A0 result
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return result
>
> number=3Dinput('type a number')
> print (double(int(number)))
>

I think what was meant:

def double(value):
=C2=A0 =C2=A0 result =3D 2 * value
=C2=A0 =C2=A0 return result
--
http://mail.python.org/mailman/listinfo/python-list

#get = the string of numbers outside your function:

is_even
number =3D input(&quo= t;type an integer')

#Here is some code to loop through eac= h digit

for n in number:
<= div class=3D"gmail_extra">=C2=A0=C2=A0=C2=A0 is_even_digit(n)=C2=A0 # this = function should test the number and print what you want for odd and even
#This will pass each digit to your fun= ction.=C2=A0 I renamed your function to reflect better python naming conven= tions



--
Joel Goldstick
--f46d044304f861f1d004d2a5da62--