What is the problem with this syntax: (this is Python 2)
num=""
word=[]
while ((num = raw_input("Enter a number: "))!='done'):
if num!='done':
word.append(num)
print 'Maximum: ',float(max(word))
print 'Minimum: ',float(min(word))
Why the user input can't be in the while loop? Or how can I put this in the while condition?
I don't need the solution to resolve this problem I am only ask why Python does not allow this?
here is my code to solve this problem: (finding the max and min form list until user enter "done")
num=''
word=[]
while (num!='done'):
num = raw_input("Enter a number: ")
if num!='done':
word.append(num)
print 'Maximum: ', float(max(word))
print 'Minimum: ', float(min(word))