0
[Solved]Python output problem
What is the output of this code? a=[0,57,28] a.sort(reverse=True) print(a[2]) Can anyone explain what would be the output and why??
2 Respuestas
+ 2
Here reverse=True means array will sort in reverse order means greater value should come first.
So a will be = [57, 28, 0]
and a[2] = 0
when reverse= False, a will be [0, 28, 57]
+ 1
Thanks AJ #Infinity Love