摘要: # 1.编写装饰器,为多个函数加上认证的功能(用户的账号密码来源于文件), # 要求登录成功一次,后续的函数都无需再输入用户名和密码\ bool_ = False def login(func): def inner(*args,**kwargs): global bool_ '''登陆''' if 阅读全文
posted @ 2019-03-14 23:45 ChenGouDa 阅读(66) 评论(0) 推荐(0) 编辑
摘要: user_list=[] _bool = True board = ['张三','李小四','王二麻子'] while _bool: dic = {} username = input('账号>>>') if username.lower() == 'q': _bool = False #如果需要多个地方终止循环尽量用bool,也可以用break、 ... 阅读全文
posted @ 2019-02-25 16:16 ChenGouDa 阅读(122) 评论(0) 推荐(0) 编辑
摘要: li = [11,22,33,44,55,77,88,99,90]大于66加入到一个ey,小于66加入到一个ey li = [11,22,33,44,55,77,88,99,90] result = {} l1 = [] l2 = [] for row in li: if row > 66: l1.append(row) # result.setdef... 阅读全文
posted @ 2019-02-25 12:31 ChenGouDa 阅读(549) 评论(0) 推荐(0) 编辑
摘要: username = input('请填写账号>>>') password = input('请填写密码>>>') with open('log',mode='w',encoding='utf-8') as f: # f.write('账号:' + username + '\n' +'密码:' + password) f.write('账号:{}\n密码:{}'.format(u... 阅读全文
posted @ 2019-02-21 12:01 ChenGouDa 阅读(160) 评论(0) 推荐(0) 编辑
摘要: li = ['手机','电脑','鼠标垫','键盘','鼠标'] print('欢迎光临!') dic = {} for x in li: print('{}\t{}'.format(li.index(x),x)) dic.setdefault(li.index(x),x) while 1: num = input('>>>/输入Q退出') if num.uppe... 阅读全文
posted @ 2019-02-16 23:01 ChenGouDa 阅读(72) 评论(0) 推荐(0) 编辑
摘要: #print(3>4 or 4<3 and 1==1)# f or f# f# x or y x为真,返回x,否则返回y# x and y x为真,返回y,否则返回x#print(2 > 1 and 0)#print(1 < 2 and 3 < 4 or 1>2)# t or f# t#print( 阅读全文
posted @ 2019-02-15 15:37 ChenGouDa 阅读(411) 评论(0) 推荐(0) 编辑
摘要: #1-2+3-4...+99除88以外的所有数的总和 cum = 0 count = 0 while count < 99: count += 1 #输出1-99 #print(count) if count == 88: continue if count % 2 == 0: cum -= count else: ... 阅读全文
posted @ 2019-02-13 10:11 ChenGouDa 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 1.求1-100的总和 2.使用while循环输出1 2 3 4 5 6 8 9 10 3.取奇数偶数 4.1-2+3-4+5-6。。。。99的总和 5.3次机会猜数字游戏 阅读全文
posted @ 2019-02-11 09:06 ChenGouDa 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 酷狗音乐下载 阅读全文
posted @ 2019-01-29 14:42 ChenGouDa 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 编译型语言和解释型语言的区别 编译型:一次性将全部代码编译成二进制文件 C,C++,还有易语言,虽然大部分人认为易语言不是一门语言,但是我还是认为易语言也是很牛的,易语言的衍生十分的广 优点:执行效率高 缺点:开发速度慢,不能跨平台. 解释型:程序运行时,一行一行的解释成二进制 python,php 阅读全文
posted @ 2019-01-29 14:38 ChenGouDa 阅读(222) 评论(0) 推荐(0) 编辑