5
I am wrapped in a piece of code that I am doing. I need to rescue only the first 10 records of an object that I call into a for loop:
listaTabela = []
for aluno in alunos:
listaLinha = ""
listaLinha += str(aluno.getRA())
listaLinha += ";"
listaLinha += str(aluno.getNome())
listaTabela.append(listaLinha)
The way it is, it makes the loop normal as long as there are records on 'students'. Would there be a way to limit this loop so that it only runs on the first 10 records? I tried using while but he repeated the same record 10 times.
Sergio, if you can correct the indentation...
– JJoao