L = ['Bart', 'Lisa', 'Adam'] x=0 while x<3: print('Hello,'+L[x]+'!') x=x+1
你好,请问你在
while x<3: print('Hello,'+L[x]+'!') x=x+1
中print中L[x]里加两个括号有什么作用?
L是个list,L[x]指向list中的str打印,不然会出现typeError
Sign in to make a reply
Run_Donitz