当前位置:网站首页>enumrate的start属性的坑
enumrate的start属性的坑
2022-07-02 07:44:00 【lanmy_dl】
enumrate的start属性
是这样的,要两个for循环遍历,取出数据,并且第二个for循环可以在第一个之后取节省处理了的时间,我用了enumerate,结果以为start属性和我想的不一样start属性说明
for index1,((xx1, yy1), rr1, grbb1) in enumerate(center): # 从第一个点开始
for index2,((xx2, yy2), rr2, grbb2) in enumerate(center,start=index1+1):
###code
即使下标变成1,还是和第0个相同
原来只是改变开始值的下标,还是从头给你遍历,这样下标虽然记录的变了,但是数据还是从头取。。。
还是老实用for循环把,突然懂了一般训练代码里面有时候用两个for循环
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
边栏推荐
- Iii. Système de démarrage et d'horloge à puce
- I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
- TIPC Cluster5
- Hdu1228 a + B (map mapping)
- TIPC介绍1
- [play with FPGA learning 4 in simple terms ----- talk about state machine design]
- C#中索引器
- ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
- Luogu p4281 [ahoi2008] emergency gathering / gathering (tree doubling LCA)
- LabVIEW为什么浮点数会丢失精度
猜你喜欢

洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)

Overview of integrated learning

华为应用市场应用统计数据问题大揭秘

JSP webshell free -- webshell free

Implement custom drawer component in quick application

Flink two Open, implement Batch Lookup join (attached source)

Internship report skywalking distributed link tracking?

Hdu1234 door opener and door closer (water question)

How to transfer event objects and user-defined parameters simultaneously in Huawei express applications

三.芯片启动和时钟系统
随机推荐
Resources读取2d纹理 转换为png格式
Summary of cases of players' disconnection and reconnection in Huawei online battle service
The most detailed MySQL installation tutorial
flink二開,實現了個 batch lookup join(附源碼)
Iii. Système de démarrage et d'horloge à puce
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
【深入浅出玩转FPGA学习3-----基本语法】
全网显示 IP 归属地,是怎么实现的?
2022爱分析· 国央企数字化厂商全景报告
TIPC Cluster5
2022-06-17
Use Huawei performance management service to configure the sampling rate on demand
Is the account above changtou school safe?
【深入浅出玩转FPGA学习5-----复位设计】
Huawei game failed to initialize init with error code 907135000
The difference between self and static in PHP in methods
Mongodb learning and sorting (condition operator, $type operator, limit() method, skip() method and sort() method)
Jenkins安装
二叉树专题--【深基16.例7】普通二叉树(简化版)(multiset 求前驱 后继 哨兵法)
Special topic of binary tree -- [deep base 16. Example 7] ordinary binary tree (simplified version) (multiset seeks the precursor and subsequent sentry Art)