2. feladat

This commit is contained in:
Kónya Márton 2020-08-25 02:02:14 +02:00
parent 5bca0b987a
commit 2252fbcbbc
1 changed files with 10 additions and 2 deletions

View File

@ -9,7 +9,7 @@ class meres():
if __name__ == "__main__": if __name__ == "__main__":
#Read in the data # 1. Feladat: Read in the data
meresek = [] meresek = []
file = open("tavirathu13.txt") file = open("tavirathu13.txt")
@ -19,4 +19,12 @@ if __name__ == "__main__":
line.split()[2], line.split()[2],
line.split()[3])) line.split()[3]))
# 2. Feladat:
inCity = input("Adja meg egy település kódját! Település: ")
for i in range(len(meresek) - 1, -1, -1):
if meresek[i].telepules == inCity:
print(f"Az utolsó mérési adat a megadott településről {meresek[i].ido[0]+meresek[i].ido[1]}:{meresek[i].ido[2]+meresek[i].ido[3]}-kor érkezett.")
break