python
百大小伙计
这个作者很懒,什么都没留下…
展开
-
函数python
函数中的*def (a, *p) 其中的*p输入只能是元组()函数中的**def (a, **p)其中的**输入的是字典例子如下:**p = (a = 1, b = 2, c = 3)输出为{‘a’ : 1, ‘b’ : 2, ‘c’ : 3}函数的实参函数中的实参位置与函数中的位置应该一一对应,若有具体的数,具体的数应放在后面如下def (a, b = 1)...原创 2022-05-10 18:54:26 · 157 阅读 · 0 评论 -
python strip的用法
str.stripstr = '1234567'print(str.strip(12))str = '##123'print(str.strip(##))输出结果为3456789输出结果为123原创 2022-04-22 16:13:22 · 497 阅读 · 0 评论 -
python中readline和readlines的区别
1,2,3,4,56,7,8,9,10readline():只提取出第一行结果为:[‘1’,‘2’,‘3’,‘4’,‘5’]readlines()结果为:[‘1,2,3,4,5’,‘6,7,8,9,10’]原创 2022-04-22 15:36:56 · 637 阅读 · 0 评论