博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2024年1月26日

摘要: 队列,堆栈是程序开发中常用的两种数据存储模型。python中队列怎么运用呢?以下内容介绍了队列的使用和队列的函数。 from collections import deque q = deque() q.append('a') q.append('b') q.appendleft('c') prin 阅读全文

posted @ 2024-01-26 16:02 生活旅行家 阅读(30) 评论(0) 推荐(0)

摘要: 通过python提取csv文件中包含某个关键字的单元格 def search(lines, pattern): previous_lines = [] for li in lines: if pattern in li: previous_lines.append(li) return previo 阅读全文

posted @ 2024-01-26 11:59 生活旅行家 阅读(80) 评论(0) 推荐(0)

摘要: 一、如果知道序列中元素的个数,可以直接进行变量赋值。 coords = (102, 40) lon, lat = coords print(lon) print(lat) text = "news" a, b, c, d = text print(a) print(b) print(c) print 阅读全文

posted @ 2024-01-26 11:55 生活旅行家 阅读(21) 评论(0) 推荐(0)