9.6k views
24 votes
Need help finding the smallest number and ending the program with -1. This is what I got H = int(input("Enter a number or enter -1 to end)"))

smallest = H

counter=0
while(True):
number = int(input("Enter a number: "))
if(number == -1):
break
if(number < H):
smallest = number
print(number, "is the smallest")

Let me know What I'm doing wrong please

User ChrisRich
by
4.1k points

1 Answer

7 votes

Answer: your not doing anything wrong it is all good but you need to add a little more to it

Step-by-step explanation:

User Gdoron
by
4.1k points