x = raw_input("Write a number")
if x.isalpha():
print "Invalid!"
elif x%2==0:
print "The number you have written is EVEN"
elif x%2!=0:
print "The number you have written is ODD"
else:
print "Invalid!"
它应该检查数字是奇数还是偶数并打印出来。我的 if 语句检查 raw_input 是否是字母表,因为那是行不通的。我的 elif 语句检查奇数或偶数。