013_v2 python基础语法
# 数据类型 # 一般操作 #coding:utf-8 none = None # None print(none, type(none)) bool = False print(bool, type(bool)) int = 12 print(int, type(int)) float = 12.12 print(float, type(float)) str = "string" print(str, type(str)) list = [None, 11, 11.11, "string"] print(list, type(list)) tupe = (None, 11, 11.11, "string") print(tupe, type(tupe)) dict = { "name" : "zhang_san", "age" : 24, "subject_list" : ("English", "Chinese", "Math"), "subject_content" : { "English" : 88, "Chinese" : 92, "Math" : 100 } } print(dict, type(dict))
None <class 'NoneType'> False <class 'bool'> 12 <class 'int'> 12.12 <class 'float'> string <class 'str'> [None, 11, 11.11, 'string'] <class 'list'> (None, 11, 11.11, 'string') <class 'tuple'> {'name': 'zhang_san', 'age': 24, 'subject_list': ('English', 'Chinese', 'Math'), 'subject_content': {'English': 88, 'Chinese': 92, 'Math': 100}} <class 'dict'>