All pastes #812353 Raw Edit

Something

public text v1 · immutable
·published 2007-12-11 18:25 UTC
rendered paste body
# -*- coding: cp1252 -*-
x=0
alunos=-1
maiornota=0
aluno=0
maiores=0
while alunos<0 or alunos>1000:
        alunos=input("Digite o número de alunos:")
        l=[0] * alunos
        n=[0] * alunos
        print l
while x!=alunos:
        l[x]=input("Digite o código do aluno:")
        if l[x]==0:
            break
        while l[x]>20000 or l[x]<1:
            l[x]=input("Digite o código do aluno denovo, ele tem que ser um número entre 1 e 20000:")
        n[x]=input("Digite a nota do aluno:")
        while n[x]>100 or l[x]<0:
            n[x]=input("Digite a nota novamente, ela deve ser um número entre 0 e 100:")
        x=x+1
nreal=x
x=0
while x!=nreal:
    if n[x]>=maiornota:
        maiornota=n[x]
        maiores=maiores+1
    x=x+1
x=0
y=0
melhores=[0]*maiores
while x!=nreal:
    if n[x]==maiornota:
        melhores[y]=l[x]
        y=y+1
    x=x+1
print "Os melhores da turma são:"
print melhores