[Tutor] elif statement
Karim
karim.liateni at free.fr
Wed Aug 11 18:59:05 CEST 2010
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"
More information about the Tutor
mailing list