python
Snail917
这个作者很懒,什么都没留下…
展开
-
Python-求输出结果
def fn(k,v,dic={}): dic[k]=v print(dic)fn("one",1)fn("two",2)fn("three",3,{})# {'one': 1}# {'two': 2, 'one': 1}# {'three': 3}原创 2020-04-07 15:43:09 · 253 阅读 · 0 评论 -
Python-多种方式的列表排序
一、列表排序1、sort排序ls=[2,8,9,0,5,-7,-3,1]ls.sort()print(ls)2、冒泡排序,每次都拿第一个数和下一个比较,小的放前面for j in range(len(ls)): for i in range(len(ls)-1): if ls[i]>ls[i+1]: num=ls[i+1]...原创 2020-04-07 15:25:48 · 1020 阅读 · 0 评论 -
Python面试常问的概念性问题搜集
一、python内建数据类型有哪些1、int 整型2、str 字符串3、dict 字典4、list 列表5、tuple 元组6、boor 布尔型 列表 list 字典 dict 元组 tuple 集合 set 表示 [1,'a',3,ture,5] {"name":"zs","age":18,"city":"深圳"...原创 2020-04-07 16:05:18 · 188 阅读 · 0 评论 -
Python常见函数汇总
lambda X:X+2 用法类似于def fun(x): return x+2原创 2020-04-17 11:29:00 · 478 阅读 · 0 评论