0
Plzzz explain why use [0]
s = [100,84,63,97] s_sort = s.sort() print(s[::-1][0])
2 ответов
+ 2
It first reverses the list and then [0] prints the element at first position
+ 1
The use of [0] here is meant to only pass the first list item (instead of the list itself) for `print` function to work with. The [0[ specifies the list item index (the first list item's index is zero)