如何运用Python里的字典Dictionary

2024-10-27 11:49:19

1、新建一个JUPYTER NOTEBOOK文档。

如何运用Python里的字典Dictionary

3、没有定义好的是不能打印出来的,例如如下:print(d["Apple"])

如何运用Python里的字典Dictionary

5、可以直接定义字典的内容。phone_number = {"HE": "73647829874", "SHE": "47381049284", "THEY": "37294856371"}print(phone_number)

如何运用Python里的字典Dictionary

7、通过用LEN可以知道关键词的数量。len(d)

如何运用Python里的字典Dictionary
猜你喜欢