for循环创建列表 lists = [ [ 0 ] for i in range ( 4 ) ] lists [ 0 ] .append ( '1' ) lists [ [ 0, '1' ] , [ 0 ] , [ 0 ] , [ 0 ] ] [ 含 i 表达式 for i in range(n) ] 表示重复创建 n 个 含i 表达式元素 ,也可以不含i 的常数表达式 lists = [ [ 0 ] ] *4 lists [ 0 ] .append ( '1' ) lists [ [ 0, '1' ] , [ 0, '1' ] , [ 0, '1' ] , [ 0, '1' ] ] 列表做乘法表示 对象的引用,当改变其中的一个的时候 其他的相同引用也会发生变化 格式化字符串 format_spec :: = [ [ fill ] align ] [ sign ] [ #][0][width][grouping_option][.precision][type] fill :: = < any character > align :: = "<" | ">" | "=" | "^" sign :: = "+" | "-" | " " width :: = digit+ grouping_option :: = "_" | "," precision :: = digit+ type