-4
我从techer那里得到了代码。我不是gettign输出。什么是错误。它已经超出索引。我不明白请帮忙。这是什么毛病,我一直在挣扎很久?
def something(tu):
ch='a'
for i in tu:
tu[i]=ch
ch+='a'
l=[1,4,2,3,8]
something(l)
for i in l:
print(i)
print("The end!")
的expted输出
a
aa
aaa
aaaa
aaaaa
The end!
谢谢
你的缩进是错误的,函数没有返回任何东西.. –