first commit

This commit is contained in:
iProbe 2022-10-18 16:59:37 +08:00
commit ba848e218d
1001 changed files with 152333 additions and 0 deletions

7
Python/具名元组.txt Normal file
View file

@ -0,0 +1,7 @@
collections.namedtuple是一个工厂函数可以用来构建一个带字段名的元组和一个有名字的类。
from collections import namedtuple
City = namedtuple('City', 'name country population coordinates')
beijing = City('Beijing', 'CN', 2700, (116.3, 39.9))
print(beijing)