一. 实验目标
(1) 掌握python的基本语法
(2) 掌握字符串的基本函数和切片的使用
(3) 能使用pycharm开发python程序
二. 实验内容
主要代码:
word = "https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1&tn=baidu&wd=idea%E5%92%8Cmyeclipse%E7%9A%84%E5%8C%BA%E5%" \ "88%AB&oq=idea%25E5%2592%258Cmyeclipse%25E4%25BC%259A%25E5%2586%25B2%25E7%25AA%2581%25E5%2590%2597&rsv_pq=cfa5a44" \ "50008b129&rsv_t=7d82jZUYFOoWQ4mLqZiZOutNJT9T6%2BW3c0mVALvWOusBkoG6ZHaPfPEGS3E&rqlang=cn&rsv_enter=1&rsv_dl=ts_2&" \
"inputT=112400&rsv_sug1=16&rsv_sug7=100&rsv_sug2=0&prefixsug=idea%25E5%2592%258Cmyeclipse&rsp=2&rsv_sug4=121975&r"
\
"sv_sug=1"
count = 0
for i in range(33,126)
:
for j in word:
if j
== chr(i):
count+=1
print(chr(i),end="
")
print(count)
count = 0
三. 测试数据及结果