新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Python中Collections模塊數(shù)據(jù)類型的使用方法-創(chuàng)新互聯(lián)
這篇文章給大家分享的是有關(guān)Python中Collections模塊數(shù)據(jù)類型的使用方法的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考。一起跟隨小編過來看看吧。
1、Defaultdict
調(diào)用語句:
From Collections import defaultdict
2、orderedDict
實(shí)現(xiàn)字典。
from collections import OrderedDict import json d = OrderedDict() d['how'] = 1
3、Deque
import collections d = collections.deque('abcdefg') print('Deque:', d) print('Length:', len(d))
感謝各位的閱讀!關(guān)于Python中Collections模塊數(shù)據(jù)類型的使用方法就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
本文題目:Python中Collections模塊數(shù)據(jù)類型的使用方法-創(chuàng)新互聯(lián)
文章鏈接:http://www.dlmjj.cn/article/dcoecs.html