mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
17 lines
453 B
Python
17 lines
453 B
Python
def largest_elements(l):
|
|
for x in l:
|
|
maxnum = 0
|
|
for x in x:
|
|
maxnum = max(x, maxnum)
|
|
# The outer loop variable x has now been overwritten by the inner loop.
|
|
print "The largest element in the list", x, "is", maxnum
|
|
|
|
|
|
def largest_elements_correct(l):
|
|
for x in l:
|
|
maxnum = 0
|
|
for y in x:
|
|
maxnum = max(y, maxnum)
|
|
print "The largest element in the list", x, "is", maxnum
|
|
|