首页 > 其他 > 详细

第七次作业

时间:2017-09-20 21:47:13      阅读:282      评论:0      收藏:0      [点我收藏+]

1.

big=‘‘‘i‘m a big big girl
in a big big world
it‘s not a big big thing if you leave me
but i do do feel
that i too too will miss you much
miss you much
i can see the first leaf falling
it‘s all yellow and nice
it‘s so very cold outside
like the way i‘m feeling inside
i‘m a big big girl
in a big big world
it;s not big big thing if you leave me
but i do do feel
that i too too will miss you much
miss you much
outside it‘s now raining
and tears are falling from my eyes
why did it have to happen
why did it all have to end
i‘m a big big girl
in a big big world
it‘s not a big big thing if you leave me
but i do do feel
that i too too will miss you much
miss you much
i have your arms around me ooooh like fire
but when i open my eyes
you‘re gone
i‘m a big big girl
in a big big world
it‘s not a big big thing if you leave me
but i do do feel
that i too too will miss you much
miss you much
i‘m a big big girl
in a big big world
it‘s not big big thing if you leave me
but i do feel i will miss you much
miss you much‘‘‘


for i in ‘,.\?!‘:
big=big.replace(i,‘ ‘)

words=big.split(‘ ‘)
print(words)

print(‘world :‘,big.count(‘world‘))
print(‘you :‘,big.count(‘you‘))
print(‘went :‘,big.count(‘went‘))
print(‘to :‘,big.count(‘to‘))
print(‘if:‘,big.count(‘if‘))

技术分享

2.


a=list(‘123113133‘)
print(‘列表‘,a)
for i in range(len(a)):
a[i]=int(a[i])
print(‘数值‘,a)

a.append(6)

print(‘增‘,a)

a.pop()

print(‘删最后‘,a)


a[2]=1

print(‘改‘,a)

print(‘第一个3分的下标为:‘,a.index(3))


print(‘1分的同学有:‘,a.count(1))


print(‘3分的同学有:‘,a.count(3))

技术分享

3.

元组和字符串有很多共同的地方,一样是不可变的,即不能修改元组。元组通过圆括号中用逗号分割的项目定义,元组通常用在使语句或用户定义的函数能够安全地采用一组值的时候。字符串可改变值。

第七次作业

原文:http://www.cnblogs.com/wuyishan/p/7565140.html

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