python判断正负数
a1 = raw_input("please input a number")
a = int(a1)
if(a!=0):
if(a > 0):
print '这是正数'
if(a < 0 ):
print '这是负数'
else:
print 'the number is equal to 0'
a = int(a1)
if(a!=0):
if(a > 0):
print '这是正数'
if(a < 0 ):
print '这是负数'
else:
print 'the number is equal to 0'
相关文章