2013-11-01 40 views

回答

2

最可能的原因爲y我們的縮進:

y=int(raw_input('Enter a number :')) 
if y%2==0: 
    print('') 
    print('The number is even')  
else: 
    print('') 
    print('The number is odd') # Make sure this line is well indented 
0

嘗試

y=int(raw_input('Enter a number :')) 

if y&1: print('The number is odd') 
else: print('The number is even') 

並觀看了缺口,它在蟒蛇語義。

0

如上所述,它可能是關於你的縮影。也想指出,獲得換行的最佳做法是使用print而不使用('')