A function that determines whether a specified number is a positive number or a negative number
def discri(a):
if a > 0:
return str(a) + 'Is a positive number.'
elif a == 0:
return str(a) + 'Is zero.'
else:
return str(a) + 'Is a negative number.'
print(discri(15))
print(discri(0))
print(discri(-24))
Judge 15 and 0 and -24.
Recommended Posts