当前位置:网站首页>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
边栏推荐
- QT learning diary 7 - qmainwindow
- QT学习日记7——QMainWindow
- 【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
- How does the whole network display IP ownership?
- P1055 [noip2008 popularization group] ISBN number
- The most detailed MySQL installation tutorial
- Oracle 笔记
- Nodejs+express+mysql simple blog building
- PCL extracts a subset from a point cloud
- JVM之垃圾回收器
猜你喜欢
JSP webshell free -- webshell free
软件产品管理系统有哪些?12个最佳产品管理工具盘点
二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
2022爱分析· 国央企数字化厂商全景报告
JVM之垃圾回收器
Flink two Open, implement Batch Lookup join (attached source)
III Chip startup and clock system
一招快速实现自定义快应用titlebar
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?
Overview of integrated learning
随机推荐
首份中国企业敏捷实践白皮书发布| 附完整下载
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
Leetcode 182 Find duplicate email (2022.07.01)
Appgallery connect scenario development practice - image storage and sharing
快应用中实现自定义抽屉组件
MySQL lethal serial question 4 -- are you familiar with MySQL logs?
TIPC Cluster5
Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)
TIPC Getting Started6
Overview of integrated learning
I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
主键策略问题
Oracle notes
Win11 arm system configuration Net core environment variable
Flick two open, realized a batch lookup join (with source code)
【AGC】如何解决事件分析数据本地和AGC面板中显示不一致的问题?
一招快速实现自定义快应用titlebar
AppGallery Connect场景化开发实战—图片存储分享
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
Huawei game failed to initialize init with error code 907135000