Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, November 29, 2012

Codecademy: Multiple lists


# 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

2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I just used max() imported from math.
    Is that cheating?

    ReplyDelete


This is an example of scrolling text using Javascript.

Popular Posts