Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this is an example of answer filling
- # i file specificati NON sono visibili direttamente, ma esistono e si possono aprire
- def main():
- FILTRI = "filtri.txt"
- SERIEA = "serieA.txt"
- filtro = open(FILTRI, "r")
- elenco = open(SERIEA, "r")
- calciatori = []
- for line in elenco:
- line = line.strip()
- giocatore = line.split(" ")
- calciatori.append(giocatore)
- esclusi = []
- for line in filtro:
- giocatore = line.strip()
- esclusi.append(giocatore)
- filtro.close()
- elenco.close()
- maxPresenze = 0
- maxGiocatore = ""
- minPresenze = 99999999999
- minGiocatoe = ""
- for i in calciatori:
- giocatore = i[0] + " " + i[1]
- if giocatore not in esclusi:
- giocatore += " " + i[2] + " " + i[3] + " " + i[4]
- print(giocatore)
- presenze = int(i[2])
- if presenze > maxPresenze:
- maxPresenze = presenze
- maxGiocatore = i[2] + " " + i[0] + " " + i[1]
- elif presenze < minPresenze:
- minPresenze = presenze
- maxGiocatore = i[2] + " " + i[0] + " " + i[1]
- print(f"presenze min: {minPresenze}")
- print(f"presenze max: {maxPresenze}")
- main()
Advertisement
Add Comment
Please, Sign In to add comment