PythonForDataAnalysis icon indicating copy to clipboard operation
PythonForDataAnalysis copied to clipboard

有關enumerate的問題 王彥博

Open brian831028 opened this issue 6 years ago • 1 comments

Q2

老師我在for in 裡面for的參數單純設一個i當作參數他跑不動,但我如果設XXX,XXX格式的參數的話,就跑得出東西,想請問一下這是什麼原理?@@

brian831028 avatar May 12 '20 11:05 brian831028

圖像-1

for i in enumerate(names): print('name[{0:d}]:{1:s}'.format(i[0],i[1]))

roberthsu2003 avatar May 13 '20 10:05 roberthsu2003