-3

by using only a temporary variable, a for loop, and an if to compare the values-hackinscience.org
Find the biggest value in a given list.

the_list = [ 143266561, 1738152473, 312377936, 1027708881, 1495785517, 1858250798, 1693786723, 1871655963, 374455497, 430158267, ]

casey
  • 3
  • 1
  • 1
    [How do I ask and answer homework questions?](https://meta.stackoverflow.com/q/334822) – kaya3 Jan 11 '21 at 02:18

2 Answers2

0

No need for either of that. Use max(the_list).

Richard Neumann
  • 2,986
  • 2
  • 25
  • 50
0
max_in = 0

for val in the_list:
    if val > max_in:
        max_in = val

There is the for, there is the if, max_in is somehow a temp var cause it changes over the loop. You get it.

Synthase
  • 5,849
  • 2
  • 12
  • 34
  • ok thanks this worked, I know they may way better methods but I'm very new to python and just trying to get my head around for loops and IFs lol – casey Jan 11 '21 at 02:29