0, not -2.
def largest(nums):
best = 0
for n in nums:
if n > best:
best = n
return best
print(largest([-4, -2, -9]))
Which changes make the program print -2? Choose every correct option.One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.
Log in to join the discussion.
Loading…