2
I have the following list whose elements are dictionaries:
[{'nome': 'ana', 'cpf': '1000', 'endereco': 'rua xxxx'}, {'nome': 'carlos', 'cpf': '7770', 'endereco': 'Rua aaaa'}]
I want to do the search by people’s name and name
nome = input("Digite o nome que deseja buscar: ")
for i in range(0, len(cl_cadastrados)):
cl = cl_cadastrados[i]
if (nome == cl['nome']):
...
...
Is there any simpler way to perform this algorithm? There is some way to access a dictionary inside the list directly without using an auxiliary variable as I am doing. Still getting familiar with Python I’m more used to programming in C.