largest = None
smallest = None
while True:
num = raw_input("Enter a number: ")
if num == "done" : break
try:
halo = float(num)
except:
print("invalid output")
continue
for largest in range(halo):
if largest is None:
largest = halo
elif largest > halo:
largest = halo
for smallest in range(halo):
if smallest is None:
smallest = halo
elif smallest<halo:
smallest = halo
print("largest is",largest)
print("smallest is",smallest)
我想打印最小和最大的数字但是我得到一个错误 “start必须是第11行的整数” 我知道我的代码中会有其他错误,但我想先纠正这个错误