#方法一
member = [‘小甲鱼‘, 88, ‘黑夜‘, 90, ‘迷途‘, 85, ‘怡静‘, 90, ‘秋舞斜阳‘, 88]
i=0
lenth=len(member)
while i<lenth:
print(member[i],member[i+1])
i+=2
#方法二
member = [‘小甲鱼‘, 88, ‘黑夜‘, 90, ‘迷途‘, 85, ‘怡静‘, 90, ‘秋舞斜阳‘, 88]
i=0
for string in member:
print(member[i],member[i+1])
i+=2
#方法三
member = [‘小甲鱼‘, 88, ‘黑夜‘, 90, ‘迷途‘, 85, ‘怡静‘, 90, ‘秋舞斜阳‘, 88]
for each in range(len(member)):
if each%2==0:
print(member[each],member[each+1])
时间: 2024-10-22 12:45:43