4
I am writing a program that takes a specific amount of values, and returns the lowest value of the list and its position. It is as follows:
quantidade = int(raw_input())
numeros = raw_input()
NumerosNaLista = numeros.split()
if len(NumerosNaLista) == quantidade:
MenorValor = min(NumerosNaLista)
print "Menor valor:", MenorValor
I tried to use find
to find the position of the lowest value in NumerosNaLista
, but it doesn’t work. How to proceed?
I understand. I need to submit my code to a website, which only accepts if it is correct, that is, if it works. I wrote two codes that work, but he does not accept, and apparently he wants me to write using loops that replace the smallest values found and save his position. I’ll put the second code, I’d like you to take a look.
– Guilherme Santana De Souza
@Guilhermesantanadesouza, I get it, is one of those programming marathon sites, has some very boring exercises.
– Brumazzi DB
In fact it’s a site used by teachers... They register problems, and students have to solve and send... Who does not send, is without presence... Despite some mistakes, my two codes meet what the problem asks, and the site did not accept... Thanks for the touches.
– Guilherme Santana De Souza