Skip to content

Commit

Permalink
Add extra fields
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Dec 12, 2024
1 parent e7e7659 commit 78ab500
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion 3-actividades-con-huecos.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@
actividadyusuarios = {}
usuariosyhorarios = {}

horarios = {}
horarios[7] = "11:30"
horarios[8] = "09:00"
horarios[9] = "10:00"
horarios[10] = "12:30"


print("NOMBRE,PLAZAS,USADAS,LIBRES,HORA,AÑO INICIO,AÑO FIN")
for actividad in actividades:
myid = actividad["idActivitat"]
nombre = actividad["nom"]
horario = int(actividad["idNivell"])
anyoinicio = actividad["edatMin"]
anyofin = actividad["edatMax"]

if horario in {7, 8, 9, 10}:
inscritos = common.readjson(filename=f"{myid}")
Expand All @@ -27,4 +37,6 @@
usadas = usadas + 1
libres = int(actividad["maxPlaces"]) - usadas
if libres > 0:
print(f'{nombre},{int(actividad["maxPlaces"])},{usadas},{libres}')
print(
f'{nombre},{int(actividad["maxPlaces"])},{usadas},{libres},{horarios[horario]},{anyoinicio},{anyofin}'
)

0 comments on commit 78ab500

Please sign in to comment.