在此插入代码
L = ['bart','lisa','adam'] for Lname in L: print('hello : %s ! ' % Lname )
L = ['Bart','Lisa','Adam']n = 0 while n < len(L): print('hello: %s !' % L[n]) n = n + 1
请教一下你这个L[n]是什么意思
索引
Sign in to make a reply
Assces
方案1 for in
L = ['bart','lisa','adam'] for Lname in L: print('hello : %s ! ' % Lname )
方案2 while
L = ['Bart','Lisa','Adam']
n = 0 while n < len(L):
print('hello: %s !' % L[n]) n = n + 1