今天。。好多不會的,慢慢補充python
一、python的二維數組初始化數組
s = [[0 for i in range(3)]for i in range(3)]
這樣就初始了一個3*3的二維數組spa
= [[0 for in range(col_numbers)] for i in range(rows_numbers)]code
二、blog
with open('test.txt','rb') as f: s = f.readline() s的結尾是帶着\r\n的 因此使用 s.strip('\r\n') strip參數放置你不想要的string
3\python haship
keys = ['name','age'] value = ['jason','2'] hash = {k:v for k:v in zip(kyes,value)}