![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法题
Yang on
扶我起来,我还能学
展开
-
递归获取多层json的路径及对应value
适用存在重复节点的多层json def find(dic): result = {} def findpath(dic, temp): for k, v in dic.items(): if isinstance(v, dict): temp += '.{}'.format(str(k)) findpath(v, temp) else:原创 2021-05-08 14:16:36 · 632 阅读 · 2 评论 -
冒泡排序_错误版
今天写算法的时候需要用到冒泡排序,所以就随手写了一个。后面我发现写错了,但是误打误撞还能进行排序,大家可以在评论区讨论下代码运行逻辑哦 def Bubble_sort(nums): for i in range(len(nums)): for j in range(len(nums)): if nums[i] > nums[j]: nums[i], nums[j] = nums[j], nums[i] return原创 2021-02-25 23:17:39 · 261 阅读 · 0 评论