已采纳回答 / longryzhou
scores[0]的值是45,scores[1]的值是60,scores[2]的值是75,scores[3]的值是86,scores[4]的值是49,index初始是0,第一次运行后是1,第二次是2,第三次是3,所以scores[Index]里面的Index是0就是scores[0],Index是1就是scores[1]。。。
2021-03-25
已采纳回答 / qq_加油少年_2
template="Life is short,{} " data="you need Python."result=template.format(data) print(result)不要全部写在一行啊
2021-03-21
已采纳回答 / yunfan123
a=list(map(int,input().strip().split())) # 1 2 3 4 5 -1 -2 -3 -4 -5 c=list(filter(lambda x:x>=0,a)) b=list(filter(lambda x:x<0,a)) print(c,b)# output [1,2,3,4,5],[-1,-2,-3,-4,-5]
2021-03-17
已采纳回答 / 幕布斯9526405
# Enter a codename=['Alice', 'Bob', 'Candy', 'David', 'Ellena'] names=['Alice', 'Bob', 'Candy', 'David', 'Ellena'] score=[89,72,88,79,99]scores=[89,72,88,79,99]scores.sort()y=0for a in scores: x=0 for b in score: if score[x]==scores[y]: ...
2021-03-15
已采纳回答 / 慕仔之万份收益
你的这种写法其实没问题,只是后面代码写到几千行的时候你就知道的(假如用你的这种写法就需要把前面写的所有的东西都全部拿过来放在这一个括号里输出),然后你就会明白用变量接收或用方法概括,再或者用类封装的重要性了,现在怎么教你,你就怎么学,这都是最好的方法。
2021-03-01