码迷,mamicode.com
首页 > 其他好文 > 详细

第七次作业

时间:2017-09-20 21:54:25      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:hat   outside   for   http   alt   一个   open   lin   项目   

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.

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

第七次作业

标签:hat   outside   for   http   alt   一个   open   lin   项目   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!