当前位置:网站首页>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
边栏推荐
- AppGallery Connect场景化开发实战—图片存储分享
- Why does LabVIEW lose precision in floating point numbers
- TIPC addressing 2
- 如何使用IDE自动签名调试鸿蒙应用
- Appgallery connect scenario development practice - image storage and sharing
- [play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
- One trick to quickly realize custom application titlebar
- 金山云——2023届暑期实习
- 洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
- spritejs
猜你喜欢
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
Internship report skywalking distributed link tracking?
How does the whole network display IP ownership?
Special topic of binary tree -- acwing 1589 Building binary search tree
Common methods of JS array
二.Stm32f407芯片GPIO编程,寄存器操作,库函数操作和位段操作
华为游戏初始化init失败,返回错误码907135000
【深入浅出玩转FPGA学习4----漫谈状态机设计】
如何使用IDE自动签名调试鸿蒙应用
Hdu1228 a + B (map mapping)
随机推荐
QT学习日记8——资源文件添加
三.芯片啟動和時鐘系統
flink二开,实现了个 batch lookup join(附源码)
Creation and use of unified links in Huawei applinking
【快应用】Win7系统使用华为IDE无法运行和调试项目
Complement (Mathematical Simulation
Learn open62541 -- [66] UA_ Generation method of string
[paid promotion] collection of frequently asked questions, recommended list FAQ
Nodejs+express+mysql simple blog building
Static variables in static function
The first white paper on agile practice in Chinese enterprises was released | complete download is attached
Uncover the secrets of Huawei application market application statistics
Implement custom drawer component in quick application
static 函数中的静态变量
MySQL lethal serial question 4 -- are you familiar with MySQL logs?
Internship report skywalking distributed link tracking?
From Read and save in bag file Jpg pictures and PCD point cloud
P1055 [noip2008 popularization group] ISBN number
Regular and common formulas
[in simple terms, play with FPGA learning 3 ----- basic grammar]