Python Number Dictionary:
loop = True
while loop:
num = raw_input('Please enter an integer so I can give you information about it.')
if len(num) > 0:
p = int(num) - 1
n = int(num) +1
if int(num)%2==0:
eo = "even"
else:
eo = "odd"
print "The integer " + str(num) + " is an " + str(eo) + " number that comes before " + str(n) + " and directly after " + str(p)
else:
print "Please enter a number"
No comments:
Post a Comment