为了账号安全,请及时绑定邮箱和手机立即绑定
#conding=utf-8
from collections import namedtuple

User = namedtuple("USER", ["name", "age", "city", "height"])

user = User(name="陳書劍", age=21, city="北京", height="175")


print(user.name, user.age, user.city, user.height)
from collections import namedtuple

User = namedtuple("USER", ["name", "age", "height"]

user = User(name="書劍", age=10, height=189)

print(user.name, user.age, user.height)
#conding=utf-8
from collections import deque

test = deque()
test.append("10")
test.appendleft("20")
# test.clear()
test1 = test.copy()
a = test.count(1)
test.extend(test1)
print(a)
print(test1, id(test1))
print(test, id(test))
def test():
return {
"name": "书剑",
"age": 10
}

num_test = defaultdict(test)
num_test["user"]
学习了,赞
老师说python3下的dict是有序的,但是我运行python3.5.2下的dict,每次运行出来的dict顺序都是不一样的,是随机的
30岁了呀,我才18岁

最新回答 / 慕标944563
学完能用起来才最好的
bobby老师的课永远那么实在,你能找出一个20分钟一节的免费视频不。哈哈

最新回答 / 林河
按住Ctrl,鼠标点击要查看的包,可以看他的函数
感谢老师!
new_child好像没生效
内容其实在python cookbook,或者python学习手册上,这些资料都是有的,不过老师帮你说一次,自己再看一次,也是挺不错的。
忠实粉丝!!
U哦IP哭
gjw
老师说过对机器学习感兴趣,这次又如此强调运行速度,感觉必有深意啊。
课程须知
python基础知识已经掌握。
老师告诉你能学到什么?
1、深入理解python中的tuple的功能 2、namedtuple的功能详解 3、defaultdict的功能详解 4、deque的功能详解 5、Counter功能详解 6、OrderedDict功能详解 7、ChainMap功能详解

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消