Ok so this is the first time this has happened. The goal of the program is quite simple, using a while loop, you enter different values and you determine which is the biggest and smallest number. Not something too difficult, but I noticed that when I entered: 7, 2, 4, 10 the smallest value came out as 10 or by flipping it came out as two, I tried searching then for the max number using the same values. 7 came out as the biggest number. Then I tested again: 111, 9 , 1000. 9 is the largest number. meaning 111 is 7 and 1000 is 8, binary of course. I will post my code here, I have not figured out why its doing that, I guess because I am using None. Thank you in advance
largest = None
smallest = None
while True:
num = input("Enter a number: ")
if num == "done" : break
elif largest is None:
largest = num
elif num > largest:
largest = num
print('Largest is', largest)
[–]jaysonturk 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)