2018年11月13日

摘要: 阅读全文

posted @ 2018-11-13 16:01 飞行的蟒蛇 阅读(206) 评论(0) 推荐(0) 编辑

摘要: 一、函数的参数--动态传参 1.动态接收位置参数 1.1在参数位置编写*表示接收任意多个内容 1.2动态接收参数的时候要注意: 动态参数必须在位置参数后面 def chi(a, b, *food): print("我要吃", a, b, food)chi("⼤米饭", "⼩米饭", "馒头", "⾯ 阅读全文

posted @ 2018-11-13 11:41 飞行的蟒蛇 阅读(139) 评论(0) 推荐(0) 编辑

摘要: 2. def lst(input): lst2=[] count=0 for i in range(0,len(input)): if i %2!=0: lst2.append(input[i]) return lst2 a=lst((2,9,29,36,9)) print(a) 3. def pd(input): ... 阅读全文

posted @ 2018-11-13 09:15 飞行的蟒蛇 阅读(147) 评论(0) 推荐(0) 编辑

摘要: 1. a f=open('11.txt','r',encoding='utf-8') a=f.read() print(a) f.flush() f.close() b. f=open('11.txt','a',encoding='utf-8') f.write('信不信由你') f.flush() f.close() c. f=open('11.txt','r+',encoding='utf-... 阅读全文

posted @ 2018-11-13 09:14 飞行的蟒蛇 阅读(141) 评论(0) 推荐(0) 编辑