Preview:
favorite_distance =L[k-1]

sorted_distance = sorted(L)

favorite_position = sorted_distance.index(favorite_distance)+1

print(favorite_position, end="")

​
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter