会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
滴水穿石不是靠力,而是因为不舍昼夜。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
13
14
···
45
下一页
2023年6月6日
Python 练手小项目-名片管理
摘要: 需求描述 需要写一段程序实现简单名片管理功能 程序启动展示主界面 新建名片 显示全部 查询名片 退出系统 主程序实现 ''' 名片管理系统 主程序 ''' import cards_tools while True: '''显示主界面''' cards_tools.show_menu() actio
阅读全文
posted @ 2023-06-06 18:31 晓枫的春天
阅读(55)
评论(0)
推荐(0)
2023年6月3日
pip install问题解决方案
摘要: 问题描述 pip install时出现问题如下 (venvop) E:\worksp_py\langchain>pip install langchain Looking in indexes: http://mirrors.aliyun.com/pypi WARNING: The reposito
阅读全文
posted @ 2023-06-03 08:07 晓枫的春天
阅读(1229)
评论(0)
推荐(0)
2023年6月1日
【python】Python报错:RecursionError: maximum recursion depth exceeded in comparison
摘要: 问题描述 今天测试程序的时候报错了 RecursionError: maximum recursion depth exceeded 通过查阅资料发现原因是查询过相关文档和资料后才发现了问题原因,python的递归深度是有限制的,默认为1000。当递归深度超过1000时,就会报错。 解决方案 可以将
阅读全文
posted @ 2023-06-01 22:33 晓枫的春天
阅读(633)
评论(0)
推荐(0)
2023年5月31日
Python 读取文件中文乱码
摘要: 问题描述 今天调试 Python 读取文件的时候发现中乱码了 读取方式 txt = open(filename) print(f"Here's your file {filename}:") print(txt.read()) 效果 E:\worksp_py\hardwary\hardway\fif
阅读全文
posted @ 2023-05-31 07:49 晓枫的春天
阅读(277)
评论(0)
推荐(0)
2023年5月28日
Pythion 循环打印图形
摘要: 打印等腰三角形 def print_triangle(n): for i in range(1, n + 1): a = n - i # 每一行的空白数量 for j in range(a): # 每一行 print(" ", end="") b = i * 2 - 1 # 每一行的元素 for j
阅读全文
posted @ 2023-05-28 09:15 晓枫的春天
阅读(89)
评论(0)
推荐(0)
2023年5月27日
出入栈简述
摘要: def greet(name): print(f'hello {name} !') greet2(name) print(f'getting read to say bey...') bey() def greet2(name): print(f'How are you, {name}') def
阅读全文
posted @ 2023-05-27 08:42 晓枫的春天
阅读(20)
评论(0)
推荐(0)
2023年5月25日
Pycharm 安装第三方库加速
摘要: 场景 平时安装 第三方库的时候速度不是很理想,需要使用国内地址进行加速 地址参考 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mi
阅读全文
posted @ 2023-05-25 22:09 晓枫的春天
阅读(169)
评论(0)
推荐(0)
2023年5月24日
变位词问题
摘要: 题目描述 所谓“变位词”是指两个词之间存在组成字母的重新排列关系 如:heart和earth,python和typhon 为了简单起见,假设参与判断的两个词仅由小写字母构成,而且长度相同 参考实现1 def anagramSolution(s1, s2): alist1 = list(s1) # 字
阅读全文
posted @ 2023-05-24 21:57 晓枫的春天
阅读(40)
评论(0)
推荐(0)
快速排序
摘要: 快速排序 这是一个比较快的排序方式,中心思想是对在无序数组种找到一个基准值,然后找出比基准值小的元素和比基准值大的元素组成一个有序整体,在递归调用达到排序效果的一种算法 参考实现 Python 实现 def quickSort(arr): if arr is None or len(arr) < 2
阅读全文
posted @ 2023-05-24 10:44 晓枫的春天
阅读(16)
评论(0)
推荐(0)
2023年5月23日
插入排序
摘要: 参考实现 ''' 插入排序 初始是一个有序列表,每次从无序列表取一个元素放到合适的位置完成排序 ''' def insert_sort(list): for i in range(1, len(list)): # 此时 i 表示无序元素的索引 temp = list[i] # 新来的待排序元素 j
阅读全文
posted @ 2023-05-23 22:20 晓枫的春天
阅读(10)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
45
下一页
公告