“Python/gloss python dictionary”的版本间差异

来自菜鸟教程
跳转至:导航、​搜索
(Pywikibot 4.4.0.dev0)
 
(机器人:添加分类Python基础教程
 
第52行: 第52行:
 
</div>
 
</div>
 
<br />
 
<br />
 +
 +
[[分类:Python基础教程]]

2020年10月29日 (四) 08:48的最新版本

<languages />

Python字典

字典

字典是无序,可更改和索引的集合。在Python中,字典用大括号括起来,并且具有键和值。

创建并打印字典:

thisdict =  {

  "brand": "Ford",

  "model": "Mustang",

  "year": 1964

}

print(thisdict)