Created
October 29, 2020 08:09
-
-
Save jachym/71ad8a11de7f05057373815eb29052f7 to your computer and use it in GitHub Desktop.
Obce a koncovky
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
ice = 0 | |
ov = 0 | |
inn = 0 | |
any = 0 | |
with open("obce.csv") as obce: | |
for line in obce.readlines(): | |
(kod,nazev, status_kod, pou_kod, okres_kod, cleneni_sm_rozsah_kod, | |
cleneni_sm_typ_kod, plati_od, plati_do, datum_vzniku) = line.split(";") | |
if nazev[-3:] == "ice": | |
ice += 1 | |
elif nazev[-2:] == "ov": | |
ov += 1 | |
elif nazev[-3:] == "ová": | |
ov += 1 | |
elif nazev[-2:] == "ín": | |
inn += 1 | |
elif nazev[-3:] == "any": | |
any += 1 | |
print(ice, ov, inn, any) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment