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.
nope!
set would eliminated the repeation of numbers and then u covert it to list to make it ordered and indexible but u will get the desirable value only when u sort the numbers, so yes u have to sort date anyway.
but yes u can write it as b = sorted(set(scorelist))[1] u dont hv to convert it to a list again because sorted() function write the data in form of list
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
nope! set would eliminated the repeation of numbers and then u covert it to list to make it ordered and indexible but u will get the desirable value only when u sort the numbers, so yes u have to sort date anyway. but yes u can write it as b = sorted(set(scorelist))[1] u dont hv to convert it to a list again because sorted() function write the data in form of list