摘要:from bs4 import BeautifulSoup import requests url = 'https://www.tripadvisor.cn/' wb_data = requests.get(url) soup = BeautifulSoup(wb_data.text,'lxml') for i in soup.select('li'): if len(i.se...
阅读全文
摘要:import requests from bs4 import BeautifulSoup url='http://news.gzcc.cn/html/xiaoyuanxinwen/' res=requests.get(url) res.encoding='utf-8' soup=BeautifulSoup(res.text,'html.parser') for news in soup.sel...
阅读全文
摘要:添加一段新闻 将所有的大写转换为小写 将所有的,。转换为空格 将数据根据空格分解为单词 将分解的单词组成一个集合 声明一个空字典,将集合的words存储到空字典中 排序并打印排名前十的单词
阅读全文
摘要:1.列表,元组,字典是有顺序的,而集合是没顺序的 2.列表是以方括号形式表示,元组是以圆括号表示,字典以花括号表示,集合则是以[()]的形式表示 3.列表是可变对象,它支持在原处修改的操作.也可以通过指定的索引和分片获取元素。区别于元组,可动态增加,删除,更新。 4.元组和列表在结构上没有什么区别,
阅读全文
摘要:r =list('03111232011') >>> r ['0', '3', '1', '1', '1', '2', '3', '2', '0', '1', '1'] >>> r.append('4') >>> r ['0', '3', '1', '1', '1&
阅读全文
摘要:'''webbrowser打开校园新闻列表''' import webbrowser as web web.open_new_tab('http://news.gzcc.cn/html/xiaoyuanxinwen/')
阅读全文
摘要:''' 下载一首英文的歌词或文章,统计单词出现的次数,将所有,.?!替换为空格,将所有大写转换为小写。 ''' sr='''You're ?insecure Don't know what for You're turning heads through the door Don't need make-up to cover up Being the way that you are is e...
阅读全文
摘要:for i in range(12): print(chr(9800+i),end="\t")
阅读全文
摘要:from turtle import *fillcolor("yellow")bgcolor("red")color("yellow") #定义goto函数def my_goto(x,y): up() goto(x,y) down() #画大星星my_goto(-600,200)begin_fill
阅读全文
摘要:from turtle import * fillcolor('yellow') begin_fill() while True: forward(200) left(170) if abs(pos())<1: break end_fill()
阅读全文
摘要:import turtle for i in range (5): turtle.up() turtle.goto(0,-20*(i+1)) turtle.down() turtle.circle(20*(i+1))
阅读全文
摘要:随着生态环境的污染以及生活饮食安全的隐患越来越严重,人们的健康也越来越被重视,最初,Seton Healthcare是采用IBM最新沃森技术医疗保健内容分析预测的首个客户。该技术允许企业找到大量病人相关的临床医疗信息,通过大数据处理,更好地分析病人的信息。在加拿大多伦多的一家医院,针对早产婴儿,每秒
阅读全文