Re: code confusion

2022-04-15 Thread Avi Gross via Python-list
nd. Some python modules allow you tosee the ranks of various entries and you can simply choose  the one of second rank.  But if this is HW, you are being asked to do things the old-fashioned way! LOL! -Original Message- From: Dennis Lee Bieber To: python-list@python.org Sent: Fri, Apr 15,

Re: code confusion

2022-04-15 Thread Dennis Lee Bieber
On Fri, 15 Apr 2022 08:41:20 +0100, Tola Oj declaimed the following: >i = int(input()) Obtain a single /integer/ from stdin -- note: any extraneous characters on the input line will result in a failure to convert from textual representation to internal/binary integer >lis = list(map(int

Re: code confusion

2022-04-15 Thread dn
On 15/04/2022 19.41, Tola Oj wrote: > i = int(input()) > lis = list(map(int,input().strip().split()))[:i] > z = max(lis) > while max(lis) == z: > lis.remove(max(lis)) > > print (max(lis)) > > this is an answer to a question from the discussion chat in hackerrank. i > didn't know the answer so i f

Re: code confusion

2022-04-15 Thread Chris Angelico
On Fri, 15 Apr 2022 at 17:42, Tola Oj wrote: > > i = int(input()) > lis = list(map(int,input().strip().split()))[:i] > z = max(lis) > while max(lis) == z: > lis.remove(max(lis)) > > print (max(lis)) > > this is an answer to a question from the discussion chat in hackerrank. i > didn't know the ans

code confusion

2022-04-15 Thread Tola Oj
i = int(input()) lis = list(map(int,input().strip().split()))[:i] z = max(lis) while max(lis) == z: lis.remove(max(lis)) print (max(lis)) this is an answer to a question from the discussion chat in hackerrank. i didn't know the answer so i found an answer that fitted well to the question, however