字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

时间:2023-02-13 19:27:22
for i in range(12):
print(chr(9800+i),end="/")

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

sr1="abcdefghijklmnopqrstuvwxyz"
sr2
=sr1.upper()
sr
=sr1+sr1+sr2+sr2
st
=input("please input:")
sR
=""
for j in st:
if j==" ":
sR
= sR +" "
continue
i
=sr.find(j)
if(i>-1):
sR
=sR+sr[i-3]
print(sR)

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

a=input("please input:")
print("{0: ^4}".format(a))

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

a=float(input("输入生产总值"))
b
=input("输入年份")
print("{1}年的生产总值是:{0:,.2f}亿元".format(a,b))

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

for x in range(1,10):
for y in range(1,x+1):
print("{}*{}={}".format(x,y,x*y),end=" ")
print("\n")

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

w='''I need you boo and I see you boo
And the heart's all over the world tonight
Said the heart's all over the world tonight
Hey, little mama, ooh you're a winner
Hey, little mama, yes you're a winner
I'm so glad to be yours
You're a class all your own and
Ooh, little cutie, when you talk to me
I swear the whole world stops
You're my sweetheart
I'm so glad that you're mine
You are one of a kind and
You mean to me
What I mean to you and
Together baby
There is nothing we won't do
'Cause if I got you
I don't need money
I don't need cars
Girl, you're my all
And oh, I'm into you
Girl, no one else would do
'Cause with every kiss and every hug
You make me fall in love
And now I know I can't be the only one
I bet there's hearts all over
'''
print("need出现的次数",w.count('need'))
for i in w:
w
=w.replace(","," ")
w
=w.replace("?"," ")
w
=w.replace("!"," ")
for i in w:
w
=w.lower()
print(w)

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理

import webbrowser
a
=input("输入想要打开的页数:")
webbrowser.open_new_tab(
'http://news.gzcc.cn/html/xiaoyuanxinwen/'+str(a)+'.html')

字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理字符串操作练习:星座、凯撒密码、99乘法表、词频统计预处理