I am writing a program using two None-types and for one of them I get an error. Here is the program:
largest = None
smallest =None
while True:
num = raw_input("Enter a number larger than 0: ")
if num == "done" :
break
try:
float(num)
except:
print 'Invalid input'
continue
if num < 0:
print'number is smaller than 0'
continue
if num > largest:
largest = num
elif num < smallest:
smallest = num
else:
continue
str(largest)
str(smallest)
print ('Maximum is '+ largest)
print ('Minimum is '+ smallest)
I always get:
TypeError: cannot concatenate 'str' and 'NoneType' objects on line 23.
The answer may be simple, but I'm just a 12 year old beginner. Please help me.