首页 > 其他 > 详细

作业3

时间:2018-09-22 20:21:56      阅读:143      评论:0      收藏:0      [点我收藏+]

strBig="""Remembering me,   Discover and see   All over the world,   Shes known as a girl   To those who a free,   The mind shall be key   Forgotten as the past   Cause history will last   God is a girl,   Wherever you are,   Do you believe it, can you recieve it?   God is a girl,   Whatever you say,   Do you believe it, can you recieve it?   God is a girl,   However you live,   Do you believe it, can you recieve it?   God is a girl,   Shes only a girl,   Do you believe it, can you recieve it?   She wants to shine,   Forever in time,   She is so driven, shes always mine   Cleanly and free,   She wants you to be   A part of the future,   A girl like me   There is a sky,   Illuminating us, someone is out there   That we truly trust   There is a rainbow for you and me   A beautiful sunrise eternally   God is a girl   Wherever you are,   Do you believe it, can you recieve it?   God is a girl   Whatever you say,   Do you believe it, can you recieve it?   God is a girl   However you live,   Do you believe it, can you recieve it?   God is a girl   Shes only a girl,   Do you believe it, can you recieve it? """ s1=strBig.lower() print(s1) strList=strBig.split() print(strList) strListSort=strList.sort() print(strListSort) print(strList) for word in strList: strList.count(word)

技术分享图片

classmates=["Mike","Bob","Tracy","小君","Tracy",56]
new=["Rose","Jack"]
classmates.insert(2,"Tom")
classmates.append("Jack")
classmates.extend(new)
print(classmates)
classmatesSet=set(classmates)
classmatesSet.add("Jack")
classmatesSet.remove("Bob")
print(classmates)
print(list("ababcd"),tuple("ababcd"))

技术分享图片

 

 

列表:用list()函数或者[]创建,是可变序列。
元组:用()或者tuple()函数来实现;是不可变序列。
字典:用dict()函数或者{}创建,使用键-值(key-value)存储,键是不可变的对象。
集合:用set()函数或者{}创建,是一个无序不重复元素集。

作业3

原文:https://www.cnblogs.com/ccyyjj/p/9679829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!