[Tutor] elif statement

Sudarshana Banerjee sudarshana.b at gmail.com
Fri Aug 13 03:40:44 CEST 2010


Thank you Karim.. the code is not actually part of anything... but is a
textbook example, literally (Python Power by Matt Telles).

On Wed, Aug 11, 2010 at 9:59 AM, Karim <karim.liateni at free.fr> wrote:

>
> Hello,
>
> This code works for me:
>
>
> >>> x=3
> >>> if x==0:
> ...     print "x is 0"
> ... elif x&1 ==1:
> ...     print "x is a odd number"
> ... elif x&1==0:
> ...     print "x is a even number"
> ...
>
> x is a odd number
>
> So I think you copied by error the string '-- Line 6' in you example given
> that has nothing to
> do with the rest of the code.
>
> Regards
> Karim
>
>
>
> On 08/11/2010 03:34 AM, Sudarshana Banerjee wrote:
>
>>    print "x is a even number"
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100812/4c224691/attachment.html>


More information about the Tutor mailing list