Checking Values In For Loop

How would I check for the highest value inside a for loop?

Like if my for loop prints out

3575
3622
3660
3705
3712
3710
3697
3675

how could I set the highest value equal to 3712 just using loops and if statements?


Assume the first element is the highest element. As you loop through the values, check if the current value is higher than the highest value. If so, update the highest value. After the loop, you're guaranteed to have the highest value.
How could I save the number from the first iteration over to the second iteration? When I try to do it, it just gives me the last number of iteration.
Create a variable before the loop?
Thank you so much.
You're a boss.
I forgot to do that.
Topic archived. No new replies allowed.