Created
June 4, 2021 04:39
-
-
Save sameerg07/ca29f67126e63e5e78f83e4aabc3dbc5 to your computer and use it in GitHub Desktop.
second largest number in a list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read the input list | |
import ast,sys | |
input_str = sys.stdin.read() | |
input_list = ast.literal_eval(input_str) | |
# Write your code here | |
try: | |
print(list(set(sorted(input_list)))[-2]) | |
except: | |
print("not present") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment