fork download
  1. #定义列表,存储常用的标注工具名称
  2. tools=["LabelMe","VIA","CVAT"]
  3. #输出列表内容
  4. print("#"*40)
  5. print("工具内容")
  6. print("输出列表:",tools)
  7. print("工具数量:",len(tools))
  8. print("第一个工具:",tools[0])
  9. print("最后一个工具:",tools[-1])
  10. print()
  11. print("="*40)
  12. print("工具介绍(使用循环)")
  13. #使用循环遍历上述列表
  14. index=1
  15. for tool in tools:
  16. description=f"工具:{tool}--适用于数据标注"
  17. print(f"{index}.{description}")
  18. index+=1#序号递进
  19. #输出循环结束提示
  20. print("\n循环完成!共输出了",len(tools),"个工具介绍。")
  21. print("="*40)
Success #stdin #stdout 0.07s 14156KB
stdin
Standard input is empty
stdout
########################################
工具内容
输出列表: ['LabelMe', 'VIA', 'CVAT']
工具数量: 3
第一个工具: LabelMe
最后一个工具: CVAT

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

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