python学习笔记整理 数据结构--字典 无序的 {键:值} 对集合 用于查询的方法 len(d) Return the number of items in the dictionary d. 返回元素个数 d[key] Return the item of d with key key. Raises a KeyError if key is not in the map. If a subclass of dict defines a method _missing_() and key…
1 再谈print和import 1.1 打印多个参数 print 能够同时打印多个表达式,并且能自定义分隔符.如下: print('a','b','c') ——> a b c print('a','b','c',sep="_") ——> a_b_c 1.2 import 导入模块时,能够给导入的模块取一个别名(相对于生活中的小名,不管怎么叫,还是你而已),方法是在语句末尾添加 as 子句并指定别名. import math as foobar from pi import…