# sample solution
# the zip function will only iterate a number of times equal to the length of the shorter list
list_a = [3, 9, 17, 15, 19]
list_b = [2, 4, 8, 10, 30, 40, 50, 60, 70, 80, 90]
for a, b in zip(list_a, list_b):
if a >= b:
print a
else:
print b
# the zip function will only iterate a number of times equal to the length of the shorter list
list_a = [3, 9, 17, 15, 19]
list_b = [2, 4, 8, 10, 30, 40, 50, 60, 70, 80, 90]
for a, b in zip(list_a, list_b):
if a >= b:
print a
else:
print b
This comment has been removed by a blog administrator.
ReplyDeleteI just used max() imported from math.
ReplyDeleteIs that cheating?