We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
In this case, it is used to find the second most greater number.
You can use brakets to select the index of a list and return the value.
So, for example:
l=[1,2,3,4,5]l[0]# Returns 1l[-1]# Returns 5
While positive numbers start from left to right, negative numbers start from right to left
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
In this case, it is used to find the second most greater number. You can use brakets to select the index of a list and return the value. So, for example:
While positive numbers start from left to right, negative numbers start from right to left