不知道代码哪里错了
https://xxx.ilovefishc.com/forum/201310/05/060640if12iygzasr3z2jm.png打出这个样式这个代码怎么错了
member = ['小甲鱼','黑夜','迷途','怡静','求无斜阳']
member.insert(1,88)
member.insert(3,90)
member.insert(5,85)
member.insert(7,90)
member.append(88)
for temp in member:
if temp.isdigit():
print(temp)
else:
print(temp,end='')
member = ['小甲鱼','黑夜','迷途','怡静','求无斜阳']
member.insert(1,'88') #这里把数字改成字符串形式就好了
member.insert(3,'90')
member.insert(5,'85')
member.insert(7,'90')
member.append('88')
for temp in member:
if temp.isdigit():
print(temp)
else:
print(temp,end='') temp.isdigit()
isdigit()是字符串方法,只有字符串形式的temp才能调用 改一下就好了
页:
[1]