fruits = [‘banana‘, ‘apple‘, ‘mango‘] for index in range(len(fruits)):#len能取出元组中的字符串 print ‘当前水果 :‘, fruits[index] print "Good bye!" #当前水果 : banana 当前水果 : apple 当前水果 : mango Good bye!
python___for语句中range()len()使用
原文:https://www.cnblogs.com/toooof/p/13712848.html