I'm trying to input numbers, and I want my function to return the smallest number.
However, my code seems to stop executing early: as soon as one number in the input is less than the other.
a = input("")
smallest = 0
a = a.split(" ")
numbers = a
def smallestindex(numbers):
for i in range(len(numbers)):
b = int(numbers[i])
smallest = int(numbers[0])
print(b)
if b < smallest:
smallest = b
return smallest
print (smallestindex(numbers))
l = [int(i) for i in numbers]; print(l.index(min(l))):-P