list1=[i for i in list(map(int,input().split()))] for i in list1: if i<=0: j=list1.index(i) break list2=[i for i in list1[0:j]] print(">=85:",len([i for i in list2 if i>=85])) print("60-84:",len([i for i in list2 if i<85 and i>=60])) print("<60:",len([i for i in list2 if i<60])) 为什么这个报错啊
y=l=z=0 li=list(map(int,input().split())) for n in li: # TODO: write code... if n<=0: break elif n>=85: y+=1 elif n>60 and n<85: l+=1 elif n<60: z+=1 print('>=85:%d'%y) print('60-84:%d'%l) print('<60:%d'%z) 这样写只通过一半的样例,错在哪里