+ 1
Bhai koi btao answer 5 kaise aaye??? How instead of 5.0
m = [2,5,2.5,3,5.0] x = max(m) print(x)
2 ответов
+ 3
Sagar Kumar Bro I was a little off in my first explanation. Here is a new one.
They're the same but I think it is because the index of 5 is less than 5.0. which means iteration of 5 comes first before 5.0.
Try this for example:
m = [2, 5.0, 5, 2.5, 3]
x = max(m)
print(x)
>> 5.0
because 5.0 comes first before 5
This is what happens in the background when using max.
https://code.sololearn.com/ca1482a3A17a
+ 2
Thanks brother