I don't understand why this doesn't work. I want to print the highest negative value from a series of user-inputted negative ints. E.g., user inputs: -1, -5, -3, program returns -1. But my program (below) is returning -5. Why is this? Is my code totally messed up? I know I can use a list and max way around it but I don't want to over-complicate the program.
x = 0
done = False
while not done:
y = int(input("Enter another number (0 to end): "))
num = y
if num != 0:
if num < x:
x = num
else:
done = True
print(str(x))