My own for/else (was fun to make)


#1


number_list_1 = [1, 4, 7, 23]
number_list_2 = [54, 2, 5, 12]

for a, b in zip(number_list_1, number_list_2):
if a == b:
print "There is no difference between the numbers!"
break
if a != b:
print "The differnce between", a, "and", b, "is:"
if a > b:
print a - b
else:
print b - a
else:
print "That's cool!"


#2

number_list_1 = [1, 3, 4, 7, 23, 33, 4]
number_list_2 = [54, 3, 2, 5, 12, 33, 4]

for a, b in zip(number_list_1, number_list_2):
if a == b:
print "There is no difference between the numbers!"
elif a != b:
print "The difference between", a, "and", b, "is:"
print abs(a - b)
else:
print "That's cool!"