2024年7月3日

快速排序

摘要: #也是用到过,找出数组中最大值 def find_bigest(arr): if(len(arr) == 1): return arr[0] if(arr[0] > arr[-1]): return find_bigest(arr[:-1]) else: return find_bigest(arr 阅读全文

posted @ 2024-07-03 21:08 阿斯利康闪电 阅读(2) 评论(0) 推荐(0) 编辑

4.3

摘要: def find_bigest(arr): if(len(arr) == 1): return arr[0] if(arr[0] > arr[-1]): return find_bigest(arr[:-1]) else: return find_bigest(arr[1:]) _ = [1,45, 阅读全文

posted @ 2024-07-03 19:00 阿斯利康闪电 阅读(3) 评论(0) 推荐(0) 编辑

4.2

摘要: def total_number(arr): if len(arr) == 1: return 1 return 1 + total_number(arr[:-1]) _ = [1,2,3,4,5,6] print(total_number(_)) 阅读全文

posted @ 2024-07-03 16:26 阿斯利康闪电 阅读(2) 评论(0) 推荐(0) 编辑

算法图解 4.1

摘要: def total(arr): if len(arr) == 1: return arr[0] return arr.pop() + total(arr) _ = [1,2,3,4,5,7] print(total(_)) 阅读全文

posted @ 2024-07-03 16:16 阿斯利康闪电 阅读(1) 评论(0) 推荐(0) 编辑

2024年6月30日

python 列表相关操作

摘要: 访问元素 index(x):返回列表中第一个值为 x 的元素的索引。 python fruits = ['apple', 'banana', 'cherry'] print(fruits.index('banana')) # 输出: 1 count(x):返回列表中值为 x 的元素的个数。 pyth 阅读全文

posted @ 2024-06-30 20:55 阿斯利康闪电 阅读(1) 评论(0) 推荐(0) 编辑

2024年6月29日

python 去除空格

摘要: 在 Python 中,要去除字符串两边的空格(包括空格、制表符等空白字符),有几种常用的方法: 使用 strip() 方法: strip() 方法可以去除字符串两边的空格和制表符(包括换行符等)。它返回一个新的字符串,不会修改原始字符串。 s = " hello, world " stripped_ 阅读全文

posted @ 2024-06-29 12:27 阿斯利康闪电 阅读(7) 评论(0) 推荐(0) 编辑

2024年5月29日

gets()和fgets()

摘要: gets() 和 fgets() 用法 #define NUM 10; //gets()用法 char str[NUM]; gets(str); //fgets()用法 char str[NUM]; fgrts(str,NUM,stdio);//stdio是指标准的输入 注意事项 gets()读到' 阅读全文

posted @ 2024-05-29 22:20 阿斯利康闪电 阅读(1) 评论(0) 推荐(0) 编辑

2024年5月25日

与非门(NAND)

摘要: 与非门 只有双1出0 或者说是有0出1 阅读全文

posted @ 2024-05-25 15:29 阿斯利康闪电 阅读(5) 评论(0) 推荐(0) 编辑

2024年4月24日

git教程

摘要: https://blog.csdn.net/qq_36667170/article/details/79085301 阅读全文

posted @ 2024-04-24 22:42 阿斯利康闪电 阅读(2) 评论(0) 推荐(0) 编辑

2024年4月22日

pip 升级库

摘要: pip install --upgrade [库名] 升级库 阅读全文

posted @ 2024-04-22 17:40 阿斯利康闪电 阅读(2) 评论(0) 推荐(0) 编辑

导航