Solve exo 1

This commit is contained in:
Gabriel Augendre 2019-11-26 20:04:53 +01:00
parent f13e8da7ea
commit 2dc25838c2
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4

15
exo1.py
View file

@ -1,5 +1,18 @@
import sys
def main():
pass
lines = []
for line in sys.stdin:
lines.append(line.rstrip("\n"))
lengths = {}
for line in lines[1:]:
name, length = line.split()
length = int(length)
lengths[length] = name
print(lengths[sorted(lengths.keys())[0]])
if __name__ == "__main__":