Cómo segmentar e integrar datos de edad en Python
list_age=
list_name=["Jack", "John", "Tom", "Bob", "Henry", "Sandy", "Halen"]
dict_person=dict(zip(list_name, list_age))
lista=[]
listb=[]
listc=[] p>
listd=[]
para k, j en dict_person.items():
si jgt;=20 y j lt;30:
lista.append((k,j))
elif jgt;=30 and j lt;40:
listb.append((k,j))
elif jgt;=40 y jlt;50:
listc.append((k,j))
else:
listd.append ((k, j))
print(f"Grupo de edad 20~29:{lista}\nGrupo de edad 30~39:{listb}\nGrupo de edad 40~49:{listc}\ nOtros: {lista}")