摘要: 返回一个字典,包含所有在本函数调用时存在的变量 阅读全文
posted @ 2018-04-08 21:09 我们分头打钱! 阅读(113) 评论(0) 推荐(0) 编辑
摘要: %s 需格式化转换为字符串,所有对象类型都可以转换为字符串类型 %d 十进制整数 %f 浮点数 %[(name)] [(flags)] [(width)] [.precision] typecode # %和字符吗之间可以:放一个字典的键 左对齐(-) 正负号(+) 补零(0) 阅读全文
posted @ 2018-04-08 21:00 我们分头打钱! 阅读(160) 评论(0) 推荐(0) 编辑
摘要: >>> a=23414>>> a += 123>>> a23537## >>> prompt = "If you tell us who you are, we can personalize the messages you see.">>> prompt += "\nWhat is your f 阅读全文
posted @ 2018-04-02 22:53 我们分头打钱! 阅读(418) 评论(0) 推荐(0) 编辑
摘要: Ctrl+/注释(取消注释)选择的行 Shift + Enter开始新行 Ctrl + Enter智能换行 TAB Shift+TAB缩进/取消缩进所选择的行 Ctrl + Alt + I自动缩进行 Ctrl + Y删除当前插入符所在的行 Ctrl + D 复制当前行、或者选择的块 Ctrl + S 阅读全文
posted @ 2018-04-02 22:41 我们分头打钱! 阅读(276) 评论(0) 推荐(0) 编辑
摘要: >>> s='spam' >>> s=s.replace('m','111') >>> s 'spa111' >>> where=s.find('11') >>> where 3 >>> s=s[:where]+'eggs'+s[(where+2):] >>> s 'spaeggs1' >>> L= 阅读全文
posted @ 2018-03-31 10:47 我们分头打钱! 阅读(87) 评论(0) 推荐(0) 编辑
摘要: >>> s='hello,world' >>> s[::-1] #分片将会从右到左进行 'dlrow,olleh' >>> s[5:1:-1] ',oll' >>> s[5:1] '' >>> 阅读全文
posted @ 2018-03-30 21:58 我们分头打钱! 阅读(105) 评论(0) 推荐(0) 编辑
摘要: >>> s = {1,2,3,4}>>> s&{1,3}{1, 3}>>> s|{11}{1, 2, 3, 4, 11}>>> s>{1,3}True>>> s.union({1,3}){1, 2, 3, 4}>>> s.union((11,22)){1, 2, 3, 4, 11, 22}>>> s 阅读全文
posted @ 2018-03-30 17:55 我们分头打钱! 阅读(168) 评论(0) 推荐(0) 编辑
摘要: >>> def a(x): def b(y): return x+y return b >>> a(1)(4)5>>> bTraceback (most recent call last): File "<pyshell#33>", line 1, in <module> bNameError: n 阅读全文
posted @ 2018-03-25 21:45 我们分头打钱! 阅读(578) 评论(0) 推荐(0) 编辑
摘要: # 复数 d 的类是complex,调用complex中的real方法,.real() 出错,.real 不带括号正常实现 >>> d = 4j>>> type(d)<class 'complex'>>>> d.real()Traceback (most recent call last): Fil 阅读全文
posted @ 2018-03-25 18:48 我们分头打钱! 阅读(166) 评论(0) 推荐(0) 编辑
摘要: pycharm 查找并高亮参数 选中某一参数,Ctrl + Shift + F7 高亮所有该文件中所有该参数 接下来, 按 F3 在所有高亮选择中向下移动一个, Shift + F3 在所有高亮选择中向上移动一个 阅读全文
posted @ 2018-03-17 11:14 我们分头打钱! 阅读(987) 评论(0) 推荐(0) 编辑