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

作业5

时间:2017-09-20 23:12:20      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:range   bar   eve   color   ima   font   通过   mat   index   

1.

s=‘‘‘Beat It - Michael Jackson
They Told Him Don‘t You Ever Come Around Here
Don‘t Wanna See Your Face You Better Disappear
The Fire‘s In Their Eyes And Their Words Are Really Clear
So Beat It Just Beat It
You Better Run You Better Do What You Can
Don‘t Wanna See No Blood Don‘t Be A Macho Man
You Wanna Be Tough Better Do What You Can
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It
Just Beat It Beat It
Just Beat It Beat It Just Beat It Beat It
They‘re Out To Get You Better Leave While You Can
Don‘t Wanna Be A Boy You Wanna Be A Man
You Wanna Stay Alive Better Do What You Can
So Beat It Just Beat It
You Have To Show Them That You‘re Really Not Scared
You‘re Playin‘ With Your Life This Ain‘t No Truth Or Dare
They‘ll Kick You Then They Beat You
Then They‘ll Tell You It‘s Fair
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It Beat It...
Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Who Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Who‘s Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It
-‘‘‘
for i in ‘,.?!‘:
    s=s.replace(i,‘ ‘)
s=s.replace(‘\n‘,‘ ‘)
s=s.lower()
s=s.split(‘ ‘)
print(s)
print(‘it出现的次数‘,s.count(‘it‘))
print(‘beat出现的次数‘,s.count(‘beat‘))
print(‘no出现的次数‘,s.count(‘no‘))

s=‘‘‘Beat It - Michael Jackson
They Told Him Don‘t You Ever Come Around Here
Don‘t Wanna See Your Face You Better Disappear
The Fire‘s In Their Eyes And Their Words Are Really Clear
So Beat It Just Beat It
You Better Run You Better Do What You Can
Don‘t Wanna See No Blood Don‘t Be A Macho Man
You Wanna Be Tough Better Do What You Can
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It
Just Beat It Beat It
Just Beat It Beat It Just Beat It Beat It
They‘re Out To Get You Better Leave While You Can
Don‘t Wanna Be A Boy You Wanna Be A Man
You Wanna Stay Alive Better Do What You Can
So Beat It Just Beat It
You Have To Show Them That You‘re Really Not Scared
You‘re Playin‘ With Your Life This Ain‘t No Truth Or Dare
They‘ll Kick You Then They Beat You
Then They‘ll Tell You It‘s Fair
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It Beat It...
Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Who Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Who‘s Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It
-‘‘‘
for i in ‘,.?!‘:
    s=s.replace(i,‘ ‘)
s=s.replace(‘\n‘,‘ ‘)
s=s.lower()
s=s.split(‘ ‘)
print(s)
print(‘it出现的次数‘,s.count(‘it‘))
print(‘beat出现的次数‘,s.count(‘beat‘))
print(‘no出现的次数‘,s.count(‘no‘))

s=‘‘‘Beat It - Michael Jackson
They Told Him Don‘t You Ever Come Around Here
Don‘t Wanna See Your Face You Better Disappear
The Fire‘s In Their Eyes And Their Words Are Really Clear
So Beat It Just Beat It
You Better Run You Better Do What You Can
Don‘t Wanna See No Blood Don‘t Be A Macho Man
You Wanna Be Tough Better Do What You Can
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It
Just Beat It Beat It
Just Beat It Beat It Just Beat It Beat It
They‘re Out To Get You Better Leave While You Can
Don‘t Wanna Be A Boy You Wanna Be A Man
You Wanna Stay Alive Better Do What You Can
So Beat It Just Beat It
You Have To Show Them That You‘re Really Not Scared
You‘re Playin‘ With Your Life This Ain‘t No Truth Or Dare
They‘ll Kick You Then They Beat You
Then They‘ll Tell You It‘s Fair
So Beat It But You Wanna Be Bad
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It Beat It...
Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Who Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Who‘s Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It Beat It Beat It Beat It
No One Wants To Be Defeated
Showin‘ How Funky Strong Is Your Fighter
It Doesn‘t Matter Who‘s Wrong Or Right
Just Beat It
-‘‘‘
for i in ‘,.?!‘:
    s=s.replace(i,‘ ‘)
s=s.replace(‘\n‘,‘ ‘)
s=s.lower()
s=s.split(‘ ‘)
print(s)
print(‘it出现的次数‘,s.count(‘it‘))
print(‘beat出现的次数‘,s.count(‘beat‘))
print(‘no出现的次数‘,s.count(‘no‘))

2

技术分享
a=list(5201314)
for i in range(len(a)):
    a[i]=int(a[i])
print(a)
a.append(you)
a.insert(3,love)
print(a)
a.pop(3)
print(a)
print(a.index(3))
print(a.count(1))
print(a.count(3))
技术分享
3.

3.简要描述列表与元组的异同。


列表中的项目应该包括在方括号中,这样python就知道你是在指明一个列表。一旦你创建了一个列表,你就可以添加,删除,或者是搜索列表中的项目。由于你可以增加或删除项目,我们说列表是可变的数据类型,即这种类型是可以被改变的。 列表是可以嵌套的。 元组 元祖和列表十分相似,不过元组是不可变的。即你不能修改元组。元组通过圆括号中用逗号分隔的项目定义。 元组通常用在使语句或用户定义的函数能够安全的采用一组值的时候,即被使用的元组的值不会改变。元组可以嵌套。

作业5

标签:range   bar   eve   color   ima   font   通过   mat   index   

原文地址:http://www.cnblogs.com/z1-z/p/7565381.html

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