![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
萤火虫 ✨
这个作者很懒,什么都没留下…
展开
-
python库函数[::-1]
s[::-1]表示反转s中的元素s[:]表示数组中所有子模块s[:]=s[::-1]表示将原数组反转后赋值给s中每一个对应的位置s=s[::-1]表示将s反转后赋值给新的对象s(可以通过id函数查看内存地址),与题意原地修改不符。作者:yim-6链接:https://leetcode-cn.com/problems/reverse-string/solution/python3-liang-chong-fang-fa-shi-xian-fan-zhuan-zi-/来源:力扣(LeetCode)转载 2021-04-13 11:44:26 · 1423 阅读 · 0 评论 -
python官方参考文档
python官方参考文档链接原创 2021-04-10 11:09:29 · 56 阅读 · 0 评论 -
python实现排序
冒泡排序def bubble_sort1(arr): for i in range(len(arr)-1): for j in range(len(arr)-1-i): if arr[j] > arr[j+1]: arr[j] , arr[j+1] = arr[j+1], arr[j] return arr原创 2021-04-08 21:58:18 · 43 阅读 · 0 评论 -
Python 计算函数运行时间
运行时间转载 2021-04-08 21:27:51 · 446 阅读 · 0 评论 -
Python学习
标准数据类型Python3 中有六个标准的数据类型:Number(数字): int、float、bool、complex(复数)String(字符串)List(列表)Tuple(元组)Set(集合)Dictionary(字典)Python3 的六个标准数据类型中:不可变数据(3 个):Number(数字)、String(字符串)、Tuple(元组);可变数据(3 个):List(列表)、Dictionary(字典)、Set(集合)。小技巧内置的 type() 函数可以用来查询变量所指原创 2021-04-08 14:46:15 · 51 阅读 · 0 评论 -
Python format 格式化函数
Python2.6 开始,新增了一种格式化字符串的函数 str.format(),它增强了字符串格式化的功能。基本语法是通过 {} 和 : 来代替以前的 % 。format 函数可以接受不限个参数,位置可以不按顺序。实例“{} {}”.format(“hello”, “world”) # 不设置指定位置,按默认顺序‘hello world’“{0} {1}”.format(“hello”, “world”) # 设置指定位置‘hello world’“{原创 2021-04-08 15:17:46 · 55 阅读 · 0 评论