Hi guys, yeah still in the battle to learn Python. Now I discovered that if I put the print function in its current position, I get 17 printed 7 times. when I push the print in the right position I get 17 printed only once, which is what I expect. why the 7 times?
Anyone willing to discuss this?
my_list = [17, 3, 5, 10, 8, 6, 4, 2]
largest = my_list[0]
for i in range(1, len(my_list)):
if my_list[i] > largest:
largest = my_list[i]
print(largest)