pyhton 为元组命名,提高可读性

# 1.使用命名变量获取index name,age,sex,email = range(4) student = ('jim',16,'male','[email protected]') # student['name'] 'jim' # 2.使用标准库collections.namedtuple from collections import namedtuple student = n
相关文章
相关标签/搜索