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

========================================
工具介绍(使用循环)
1.工具:LabelMe--适用于数据标注
2.工具:VIA--适用于数据标注
3.工具:CVAT--适用于数据标注

循环遍历完成!总共输出了 3 个工具介绍
========================================