當前位置:成語大全網 - 新華字典 - 菜鳥求python代碼 求各位大神幫忙解答下

菜鳥求python代碼 求各位大神幫忙解答下

with?open('1.txt','r')?as?f:

a=f.readlines()

b=[]

for?i?in?a?:

i=int(i)

if?i<=100?and?i>=90?:

b.append(str(i)+":A")

elif?i>=80:

b.append(str(i)+":B")

elif?i>=70:

b.append(str(i)+":C")

elif?i>=60:

b.append(str(i)+":D")

else?:

b.append(str(i)+":E")

print(b)