2018年2月13日

运算符

摘要: 运算符:1、and,or,not(取非),默认运算算路与和短路或2、in,not in,判断在不在集合中3、is, is not,判断是不是指向同一对象 in,not in in 如果在指定的序列中找到值返回 True,否则返回 False。 x 在 y 序列中 , 如果 x 在 y 序列中返回 T 阅读全文

posted @ 2018-02-13 11:10 悬剑 阅读(102) 评论(0) 推荐(0)

时间

摘要: 打印时间import time# 格式化成2016-03-20 11:45:39形式print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 打印日历import calendarcal = calendar.month(2016, 1)p 阅读全文

posted @ 2018-02-13 11:04 悬剑 阅读(72) 评论(0) 推荐(0)

dict

摘要: dict 存放键值对 dict()返回一个dict d={'a':94,‘b’:95,'c':96} d['e']=11 新增 dict.clear() 删除 del dict 删除 d['a'] 取元素,[]+‘key’ d.get('d') 取元素 d['e']=100 新增一个键值对 dict 阅读全文

posted @ 2018-02-13 10:32 悬剑 阅读(244) 评论(0) 推荐(0)

String

摘要: x = b'ABC' b'ABC'意思是字节字符串文本、网络中的字节是有编码的,内存中的字符串是unicode编码的,转化成可传输可存储的字节需要编码String支持切片 + 字符串连接 >>>a + b 'HelloPython'*重复输出字符串 >>>a * 2 'HelloHello'[] 通 阅读全文

posted @ 2018-02-13 10:15 悬剑 阅读(101) 评论(0) 推荐(0)

number

摘要: number1、数据类型是不允许改变的,这就意味着如果改变 Number 数据类型的值,将重新分配内存空间2、del语句删除一些 Number 对象引用 阅读全文

posted @ 2018-02-13 10:12 悬剑 阅读(114) 评论(0) 推荐(0)

导航