摘要: jieba分词 import jiebaf = open(聊斋.txt', "r", encoding='gbk')words = jieba.lcut(txt)counts = {} for word in words: if len(word) == 1: continue else: coun 阅读全文
posted @ 2023-12-19 15:35 Ayers_Lynn 阅读(44) 评论(0) 推荐(0)
摘要: (2)请用requests库的get()函数访问必应主页20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。 import requestsfor i in range(20): r = requests.get("https://cn.bing.c 阅读全文
posted @ 2023-12-08 23:38 Ayers_Lynn 阅读(33) 评论(0) 推荐(0)
摘要: 代码如下: def main(): try: money = float(input("请输入金额:")) print("抹零后的金额:{}".format(int(money))) except: print("请输入数字!") # 超市抹零# try: import math a = float 阅读全文
posted @ 2023-10-31 18:36 Ayers_Lynn 阅读(30) 评论(0) 推荐(0)