当前位置:网站首页>Pit of the start attribute of enumrate
Pit of the start attribute of enumrate
2022-07-02 11:12:00 【lanmy_ dl】
enumrate Of start attribute
That's true , Two, please for Loop traversal , Take out the data , And the second for The loop can be taken after the first one to save processing time , I used it enumerate, It turns out that start The attribute is different from what I think start Attribute specification
for index1,((xx1, yy1), rr1, grbb1) in enumerate(center): # From the first point
for index2,((xx2, yy2), rr2, grbb2) in enumerate(center,start=index1+1):
###code
Even if the subscript becomes 1, Or with the 0 Same
It turned out that it was just changing the subscript of the starting value , Or I'll go through it from the beginning , Although the subscript record has changed , But the data is still taken from scratch ...
It's better to be honest for Loop handle , Suddenly I understand that there are sometimes two in the general training code for loop
for index1 in range(len(center)):
(xx1, yy1), rr1, grbb1 = center[index1]
for index2 in range(index+1,len(center)):
(xx2, yy2), rr2, grbb2) = center[index2]
###code
边栏推荐
- Use of vscode tool
- V2X-Sim数据集(上海交大&纽约大学)
- 洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
- 首份中国企业敏捷实践白皮书发布| 附完整下载
- Huawei game failed to initialize init with error code 907135000
- 快应用中实现自定义抽屉组件
- [play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
- How to transfer event objects and user-defined parameters simultaneously in Huawei express applications
- Regular and common formulas
- The most detailed MySQL installation tutorial
猜你喜欢
JVM之垃圾回收器
【AGC】构建服务3-认证服务示例
Verilog 和VHDL有符号数和无符号数相关运算
Overview of integrated learning
Uncover the secrets of Huawei application market application statistics
一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
Thanos Receiver
如何使用IDE自动签名调试鸿蒙应用
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
随机推荐
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
[play with FPGA learning 4 in simple terms ----- talk about state machine design]
STM32单片机编程学习
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
使用华为性能管理服务,按需配置采样率
Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
软件产品管理系统有哪些?12个最佳产品管理工具盘点
Indexer in C #
TIPC Service and Topology Tracking4
JSP webshell免殺——JSP的基礎
III Chip startup and clock system
Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
三.芯片啟動和時鐘系統
快应用中实现自定义抽屉组件
QT学习日记7——QMainWindow
QT learning diary 7 - qmainwindow
PHP tea sales and shopping online store
Hdu1228 a + B (map mapping)