0
Develop an algorithm that reads ten user-informed values and tells the highest and lowest read value.
cont = 0
n = 0
maior = n
menor = n
while cont < 3:
n = int(input('Insira os números: >>> '))
if n > maior :
maior = n
elif menor > n :
menor = n
cont = cont + 1
print(menor,maior)
What’s the matter?
– thiago dias
the code always works with the smallest = 0, I imagine it is on account of n = 0 in 2° line, but if I take the n from there the variable is as if it were not defined
– Bryan Ribeiro Melo