fork download
  1. tools=['labeIMe','VIA','CVAT']
  2. print('创建的列表内容为:',tools)
  3. print('列表长度(工具个数):',len(tools))
  4. print(len(tools))
  5. print('第一个工具是:',tools[0])
  6. print('最后的一个工具是:',tools[-1])
  7. print()
  8. print('='*40)
  9. print('工具介绍(使用循环)')
  10. index=1
  11. for tool in tools:
  12. description=f'工具:{tool}——适用于数据标注'
  13. print(f'{index}.{description}')
  14. index+=1
  15. print('循环遍历完成!总共输出了',len(tools),'个工具介绍')
  16. print('='*40)
Success #stdin #stdout 0.08s 14088KB
stdin
Standard input is empty
stdout
创建的列表内容为: ['labeIMe', 'VIA', 'CVAT']
列表长度(工具个数): 3
3
第一个工具是: labeIMe
最后的一个工具是: CVAT

========================================
工具介绍(使用循环)
1.工具:labeIMe——适用于数据标注
2.工具:VIA——适用于数据标注
3.工具:CVAT——适用于数据标注
循环遍历完成!总共输出了 3 个工具介绍
========================================