• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
umalu
博客园    首页    新随笔    联系   管理    订阅  订阅
2020年12月14日
圆圆のhtml
摘要: 1 from bs4 import BeautifulSoup 2 import re 3 soup=BeautifulSoup('''<!DOCTYPE html> 4 <html> 5 <head> 6 <meta charset="utf-8"> 7 <title>菜鸟教程(runoob.co 阅读全文
posted @ 2020-12-14 19:15 umalu 阅读(73) 评论(0) 推荐(0)
圆圆の爬虫作业之360
摘要: 1 import requests 2 url="https://hao.360.com/" 3 def gethtml(url): 4 try: 5 r=requests.get(url) 6 r.raise_for_status() 7 r.encoding="utf-8" 8 print("t 阅读全文
posted @ 2020-12-14 19:11 umalu 阅读(73) 评论(0) 推荐(0)
2020年11月22日
足球模拟
摘要: 1 # 比赛规则: 2 # 1. 比赛分为两场,每场为45分钟 3 # 上半场: 一方挑选进攻的球门,另一方获得开球权 4 # 下半场: 互换攻守方向,上半场没获得开球权的一方获得开球权 5 # 2. 在进球后开球时,开球方为失球一方 6 # 3. 在没有违反任何比赛规则时,进攻球队得分。 7 # 阅读全文
posted @ 2020-11-22 20:56 umalu 阅读(163) 评论(0) 推荐(0)
羽毛球模拟竞技
摘要: 1 from random import random 2 #第一阶段 3 def printIntro(): 4 print("模拟两个选手A和B的羽毛球比赛") 5 print("程序运行需要A和B的能力值(以0到1之间的小数表示)") 6 def getInputs(): 7 a = eval 阅读全文
posted @ 2020-11-22 20:48 umalu 阅读(96) 评论(0) 推荐(0)
圆圆的读书报告
摘要: NumPy篇: numpy.around() 函数返回指定数字的四舍五入值 numpy.floor() numpy.floor() 返回小于或者等于指定表达式的最大整数,即向下取整 numpy.ceil() numpy.ceil() 返回大于或者等于指定表达式的最小整数,即向上取整 numpy.re 阅读全文
posted @ 2020-11-22 19:29 umalu 阅读(90) 评论(0) 推荐(0)
2020年11月21日
python测验成绩单
摘要: 阅读全文
posted @ 2020-11-21 22:16 umalu 阅读(128) 评论(0) 推荐(0)
2020年11月15日
圆圆の聊斋分词
摘要: 1 import jieba 2 3 txt = open("聊斋志异白话简写版.txt", "r", encoding='utf-8').read() 4 words = jieba.lcut(txt) # 使用精确模式对文本进行分词 5 counts = {} # 通过键值对的形式存储词语及其出 阅读全文
posted @ 2020-11-15 13:08 umalu 阅读(115) 评论(0) 推荐(0)
2020年10月18日
7段数码管绘制(17号)
摘要: import turtle, datetime def drawGap(): turtle.up() turtle.fd(5) def drawLine(draw): drawGap() if(draw): turtle.down() else: turtle.up() turtle.fd(40) 阅读全文
posted @ 2020-10-18 19:07 umalu 阅读(125) 评论(0) 推荐(0)
2020年9月21日
绘制玫瑰花
摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill( 阅读全文
posted @ 2020-09-21 19:55 umalu 阅读(156) 评论(0) 推荐(0)
绘制时钟
摘要: import turtle from datetime import * # 抬起画笔,向前运动一段距离放下 def Skip(step): turtle.penup() turtle.forward(step) turtle.pendown() def mkHand(name, length): 阅读全文
posted @ 2020-09-21 19:36 umalu 阅读(363) 评论(0) 推荐(0)
下一页
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3