0

How can I print highest value in list?

Help me

12th Jan 2024, 9:16 PM
도훈 임
도훈 임 - avatar
3 Antworten
+ 6
the highest values is also called "maximum". there is a built-in max() function
12th Jan 2024, 9:35 PM
Lisa
Lisa - avatar
+ 5
도훈 임 if you choose not to use the built-in function max() you can do something like this... m=0 for x in [1,3,7,4]: if x > m: m=x print(m)
12th Jan 2024, 10:06 PM
BroFar
BroFar - avatar
+ 3
As Lisa said you can use the built-in function "max()". For example lst = [1, 3, 7, 4] print(max(lst))
12th Jan 2024, 9:39 PM
Abdurahman Jemal Adem
Abdurahman Jemal Adem - avatar