small = None
larg = None
count = 0
while True:
inp = raw_input("Enter a number: ")
if inp == "done" : break
try:
num = float (inp)
except:
print "Invalid number"
if num < small:
small = num
print "Done"
print small
This code should make user add numbers until he/she types "done" and then find the smallest number (my idea is to compare num with small each time and it print last small value after done)
But when I run it, it keep showing None
as the smallest value.