# Interesting output

**URL:** <https://forum.codewithmosh.com/t/interesting-output/6934>\
**Category:** Python\
**Created:** [August 22, 2021, 9:12am UTC](https://forum.codewithmosh.com/t/interesting-output/6934 "2021-08-22T09:12:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunKissed](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@SunKissed](https://forum.codewithmosh.com/u/SunKissed)\
**Post date:** [August 22, 2021, 9:12am UTC](https://forum.codewithmosh.com/t/interesting-output/6934/1 "2021-08-22T09:12:37Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![SunKissed](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@SunKissed](https://forum.codewithmosh.com/u/SunKissed)\
**Post date:** [August 22, 2021, 3:13pm UTC](https://forum.codewithmosh.com/t/interesting-output/6934/2 "2021-08-22T15:13:04Z")

</div>

I think I just figured this out…
