Created
November 29, 2021 16:43
-
-
Save pigmonchu/bb4b46ed0d1328a07bba2f79e7a1cef7 to your computer and use it in GitHub Desktop.
This file contains 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
def second_scored(*lis): | |
maximum = max(lis) | |
preMax = min(lis) | |
for nombre in lis: | |
if (nombre < maximum and nombre > preMax): | |
preMax = nombre | |
return preMax | |
""" | |
-EL COMENTARIO- | |
""" | |
def another_second_scored(*lis): | |
arr = list(set(lis)) | |
arr.sort() | |
return arr[-2] | |
def other_second_scored(*lis): | |
for n in lis: | |
i = 2 | |
is_second = True | |
while i <= n // 2: | |
if n % i == 0: | |
is_second = False | |
i += 1 | |
if is_second: | |
return n | |
def the_second_scored(*lis): | |
first = max(lis) | |
lis = list(lis) | |
lis.remove(first) | |
while first == max(lis): | |
lis.remove(first) | |
return max(lis) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment