Step up your FOR's, multiple lists
the instructions to the exercise are the following: "Compare each pair of elements and print the larger of the two."
I am working on stepping up your FOR's unit, doing the multiple list exercise (#16) (sorry I cannot get the link to work properly when I past it here), as it demonstrate what the ZIP function does. I tinkered around with the exercise, and the code below worked, but I am wondering if there is anything that I am missing as I feel the code is not very elegant... Anyone with a comment for my code?
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): # Add your code here! if a>=b or b>=a: print max(a,b)