- 博客(2)
- 收藏
- 关注
原创 Python列表及其基本的操作(增删改查)
Python列表及其基本的操作(增删改查)增1.insert()2.append()3.extend()删1.del()2.pop()2.1pop()2.2pop(索引)改1.列表名[索引值]=修改值统计1.count()2.index()排序1.sort()1.1默认升序1.2降序2.reverse()增1.insert()# insert(索引值,插入值) 索引值:要插入的位置;插入值:要插入的值list1.insert(3,'金箍棒')# 执行前:['唐僧','猪八戒','孙悟空','沙
2021-10-22 15:35:27
307
原创 爬虫,小说爬取,并保存为txt文件
爬取某小说网站from bs4 import BeautifulSoupimport urllib.requestfrom fake_useragent import UserAgent# 爬取数据def getdata(url): headers = { "User-Agent":UserAgent().random } res = urllib.request.Request(url,headers=headers) resp
2021-03-05 17:58:10
3473
11
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人