摘要: import requestsfrom bs4 import BeautifulSoupurl='www.google.com.hk'for i in range(20): try: r=requests.get(url) print(r.status_code) except: print(404 阅读全文
posted @ 2023-12-20 10:58 夏松鼠 阅读(30) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): # 打印程序介绍信息 print('这个程序模拟两个队伍A和B的排球竞技比赛') print('程序运行需要A和B的能力值(以0到1之间的小数表示)') print('35毛润松') def getInputs( 阅读全文
posted @ 2023-12-20 10:34 夏松鼠 阅读(11) 评论(0) 推荐(0)
摘要: import turtle, datetime def drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if draw else tur 阅读全文
posted @ 2023-11-28 21:16 夏松鼠 阅读(29) 评论(0) 推荐(0)
摘要: 运行超市抹零结账行为 print("毛润松 2022310143135")money_all = 56.75 + 72.91 + 88.50 + 26.73 + 68.51 #累加总计金额money_all_str = str(money_all)#转换为字符串print("商品的总金额为:" + 阅读全文
posted @ 2023-11-21 00:01 夏松鼠 阅读(32) 评论(0) 推荐(0)
摘要: from random import randomfrom math import sqrtfrom time import perf_counterDARTS = 10000000000hits = 0.0perf_counter()for i in range(1, DARTS+1): x, y 阅读全文
posted @ 2023-11-20 23:53 夏松鼠 阅读(34) 评论(0) 推荐(0)