i=0
list=input('请输入数组:')
list1=list[:]
while list1[i]!='\n':
print("列表中第",i+1,"个值")
i+=1
以下是报错,但也能出来东西
Traceback (most recent call last):
File "C:/Users/hp/Desktop/(8).py", line 11, in <module>
while list1[i]!='\n':
IndexError: string index out of range
孤独的小猪
相关分类