Discuss / Python / for和while

for和while

Topic source

-- coding: utf-8 -

L = ['Bart','Lisa','Adam'] n=0 while n<3: print('hello %s'%L[n]) n=n+1

-- coding: utf-8 -

L = ['Bart','Lisa','Adam'] for x in L: print('hello,',x,'!')


  • 1

Reply