Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. elenco_lettura = open("elenco_alunni.txt","r").read()
  2. elenco_alunni = elenco_lettura.split(';')
  3. print(elenco_alunni)
  4.  
  5. appello=[]
  6. registro=[]
  7. c = 0
  8. c1=0
  9. c2=0
  10.  
  11.  
  12.  
  13. for i in range (1, len(elenco_alunni)+1):
  14. print(elenco_alunni[c])
  15. presenza = int(input("1 se presente , 2 se assente "))
  16. while (presenza != 1 and presenza != 2):
  17. presenza = int(input("1 se presente , 2 se assente "))
  18. if (presenza == 1 ):
  19. appello.append("presente")
  20. elif(presenza == 2):
  21. appello.append("assente")
  22. file4 = open('lista assenze.txt','a')
  23. file4.write(elenco_alunni[c]+' '+ 'assente'+';')
  24. file4.close()
  25. c = c+1
  26.  
  27.  
  28. for i in range (1,len(elenco_alunni)+1):
  29. registro.append(elenco_alunni[c1]+' '+appello[c1])
  30. c1 = c1 + 1
  31.  
  32. print(registro)
  33.  
  34.  
  35. assenze_lettura = open("lista assenze.txt",'r').read()
  36. lista_assenze = assenze_lettura.split(';')
  37.  
  38.  
  39. while len(lista_assenze) > 0:
  40. while elenco_alunni[c2] +" "+ 'assente' in lista_assenze:
  41. ragazzo = elenco_alunni[c2]
  42. print(ragazzo,'deve giustificare')
  43. giustifica = int(input("vuoi giustificare?"))
  44. if giustifica == 1:
  45. lista_assenze.pop(c2)
  46. c2 = c2+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement