随笔分类 -  Python_development

摘要:预定义特殊方法: __lt__(self,other) 如果x<y返回true __le__(self,other) 如果x<=y返回true __eq__(self,other) 如果x==y返回true __ne__(self,other) 如果x!=y返回true __ge__(self,ot 阅读全文
posted @ 2017-07-12 00:52 _revolution 阅读(250) 评论(0) 推荐(0)
摘要:运算符 Python中比较特别的 幂3² 表示为 3**2 商的整数部分 例如10//3 = 3 还有诸如“%=” “**=” “//=” 逻辑运算“且,或,非” : “and” “or” “not” 判断元素是否在列表或字典中: "in" "not in" 判断数据类型“is” “not is” 阅读全文
posted @ 2017-07-08 18:38 _revolution 阅读(342) 评论(0) 推荐(0)
摘要:3. name = input("name:")与2.x中raw_input一回事, 注意接收的变量全部默认为字符串类型。 从控制台接收用户输入,而密文输入import getpass password = getpass.getpass("password:") 这个不能在pycharm中测试成功 阅读全文
posted @ 2017-07-05 12:25 _revolution 阅读(501) 评论(0) 推荐(0)