- 博客(12)
- 问答 (1)
- 收藏
- 关注
原创 Python爬虫
爬取一下内容:代码:import requestsimport bs4import reimport json# URLurl = 'http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do?method=getXkzsList'# 获取信息data = { 'on': 'true', 'page': '1', 'pageSize': '15', 'productName': '广州',
2020-12-21 15:41:54 436 1
原创 排球比赛--Python实现
排球比赛赛制规定:比赛采用5局3胜制,非决胜局的比赛采用15分制,一队先得15分获胜,每小局内,获得一分后交换发球权。在决胜局(第
2020-11-22 16:32:44 730
原创 添加家具--python实现
面向对象编程学习:添加家具class HouseItem: def __init__(self, name, area): self.name = name self.area = area def __str__(self): return "[%s] 占地 %.2f" % (self.name, self.area)class House: def __init__(self, house_type, area):
2020-11-14 16:04:55 335
原创 学习笔记--创建名片管理系统--python实现
制作一个名片管理系统功能包括新增、显示、查询名片,退出系统一、新建一个python文件,命名为cards_main.py先制作一个显示框架,输入0-3为具体操作(暂时不定义,用pass代替),输入其他内容则显示输入错误action_str = input("请选择希望执行的操作: ")print("您选择的操作是【%s】" % action_str)#1,2,3 针对名片的操作if action_str in ["1", "2", "3"]: pass#0 退出系统elif a
2020-11-12 17:28:10 331
原创 jieba分词统计红楼梦出现名字前20名
要求:红楼梦相关的分词,出现次数最高的20个。import jiebaexcludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么","两个","没有","不是","不知","这个","听见","这样","进来","咱们","告诉","就是", "东西","袭人","回来","只是","大家","只得","老爷","
2020-11-11 14:03:31 5285 4
原创 在终端输出信息--python
在终端输出如下信息,(两种以上方法)描述练习一:在终端输出如下信息小明,10岁,男,上山去砍柴小明,10岁,男,开车去
2020-10-30 18:51:46 1083
原创 7段数码管绘制——python实现
**7段数码管绘制**描述请学号最后一个尾号为(0,1)的同学。...
2020-10-18 16:41:22 2194
原创 蚁群优化算法matlab实现
主函数:clearclcm=5;%种群规模[pop,pheromone]=initialization(m)%分别求出初始矩阵与信息素antfirstcity=firstcity(m)%每只蚂蚁随机选择出发的城市antcity=selectcity(pop,m,pheromone,antfirstcity)%每只蚂蚁每一步选择的城市newpheromone=newpheromones(m,antcity,pop,pheromone)%更新信息素函数initialization:funct
2020-09-25 18:21:39 892
原创 重叠等边三角形绘制-python实现
代码:import turtleturtle.pencolor('orange')turtle.forward(200)turtle.right(-120)turtle.forward(200)turtle.right(-120)turtle.fd(200)turtle.right(180)turtle.fd(100)turtle.right(60)turtle.fd(100)turtle.right(120)turtle.fd(100)turtle.right(120)tur
2020-09-15 10:44:45 2962
原创 六角星绘制-python实现
代码:import turtleturtle.fillcolor('red')turtle.begin_fill()count=1while count<=6: turtle.forward(50) turtle.right(-60) turtle.forward(50) turtle.right(120) count+=1turtle.write('小郑画的')turtle.end_fill()结果:...
2020-09-15 10:41:49 2917
原创 五角星python实现
import turtleturtle.begin_fill()#count为绘制图形边数count=1cs=['red','orange','yellow','green','cyan']while count<=5: c=cs[count-1] #用指定颜色绘制每条边的颜色 turtle.color(c) turtle.forward(100) turtle.right(144) count+=1 #往整个图形填充红色 tu
2020-09-15 09:11:22 5327
原创 温度转换python代码
温度的刻画有两个不同体系:摄氏度(Celsius)和华氏度(Fahrenheit)。请编写程序将用户输入华氏度转换为摄氏度,或将输入的摄氏度转换为华氏度。
2020-09-13 16:02:08 14257 2
空空如也
django图片显示异常?
2020-12-08
TA创建的收藏夹 TA关注的收藏夹
TA关注的人