0
How can I print highest value in list?
Help me
3 Respostas
+ 6
the highest values is also called "maximum". there is a built-in max() function
+ 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)
+ 3
As Lisa said you can use the built-in function "max()". For example
lst = [1, 3, 7, 4]
print(max(lst))