Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elenco_lettura = open("elenco_alunni.txt","r").read()
- elenco_alunni = elenco_lettura.split(';')
- print(elenco_alunni)
- appello=[]
- registro=[]
- c = 0
- c1=0
- c2=0
- for i in range (1, len(elenco_alunni)+1):
- print(elenco_alunni[c])
- presenza = int(input("1 se presente , 2 se assente "))
- while (presenza != 1 and presenza != 2):
- presenza = int(input("1 se presente , 2 se assente "))
- if (presenza == 1 ):
- appello.append("presente")
- elif(presenza == 2):
- appello.append("assente")
- file4 = open('lista assenze.txt','a')
- file4.write(elenco_alunni[c]+' '+ 'assente'+';')
- file4.close()
- c = c+1
- for i in range (1,len(elenco_alunni)+1):
- registro.append(elenco_alunni[c1]+' '+appello[c1])
- c1 = c1 + 1
- print(registro)
- assenze_lettura = open("lista assenze.txt",'r').read()
- lista_assenze = assenze_lettura.split(';')
- while len(lista_assenze) > 0:
- while elenco_alunni[c2] +" "+ 'assente' in lista_assenze:
- ragazzo = elenco_alunni[c2]
- print(ragazzo,'deve giustificare')
- giustifica = int(input("vuoi giustificare?"))
- if giustifica == 1:
- lista_assenze.pop(c2)
- c2 = c2+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement