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 i struggle to understand the use of some of the methods and functions the person has used. my major questions are: 1. what does "[:i]" mean 2. is there another i could write this code using if statement? thank you -- https://mail.python.org/mailman/listinfo/python-list