摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> </head> <body> <h1>我的第一个标题</h1> <p id="first">我的第一个段落。</p> </body 阅读全文
posted @ 2020-12-14 19:22 石榴海豹 阅读(51) 评论(0) 推荐(0)
摘要: 1 import requests 2 from bs4 import BeautifulSoup 3 import bs4 4 5 def getHTMLText(url): 6 try: 7 r = requests.get(url, timeout=30) 8 r.raise_for_stat 阅读全文
posted @ 2020-12-14 19:07 石榴海豹 阅读(59) 评论(0) 推荐(0)
摘要: # encoding: utf-8 import urllib.request import urllib.parse url = "https://www.so.com/s?q=" keyword = input("请输入搜索关键词") keyword = urllib.parse.quote(k 阅读全文
posted @ 2020-12-14 18:54 石榴海豹 阅读(110) 评论(0) 推荐(0)
摘要: from random import random def printInfo(): # 打印程序介绍信息 print('这个程序模拟两个选手A和B的某种竞技比赛') print('程序运行需要A和B的能力值(以0到1之间的小数表示)') def getInputs(): # 获得程序运行参数 a 阅读全文
posted @ 2020-11-21 22:13 石榴海豹 阅读(63) 评论(0) 推荐(0)
摘要: import numpy as np ls1 = [10, 42, 0, -17, 30] nd1 =np.array(ls1) print(nd1) print(type(nd1)) import scipy import numpy as np from scipy import linalg 阅读全文
posted @ 2020-11-21 22:06 石榴海豹 阅读(46) 评论(0) 推荐(0)
摘要: import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in 阅读全文
posted @ 2020-11-14 12:43 石榴海豹 阅读(132) 评论(0) 推荐(0)
摘要: import turtle def koch(size,n): if n==0: turtle.fd(size) else: for angle in[0,60,-120,60]: turtle.left(angle) koch(size/3,n-1) def main(): turtle.setu 阅读全文
posted @ 2020-11-02 19:44 石榴海豹 阅读(68) 评论(0) 推荐(0)
摘要: #七段数码管绘制 import turtle as t import time as T def drawGap(): #绘制数码管的间隔 t.penup() t.fd(5) def drawLine(draw): #绘制单段数码管,draw为True时,则实画 drawGap(); t.pendo 阅读全文
posted @ 2020-11-02 19:38 石榴海豹 阅读(136) 评论(0) 推荐(0)
摘要: #第一种 print("小明,10岁,男,上山去砍柴") print("小明,10岁,男,开车去东北") print("小明,10岁,男,最爱打游戏") print("\n") print("老李,90岁,男,上山去砍柴") print("老李,90岁,男,开车去东北") print("老李,90岁 阅读全文
posted @ 2020-10-26 19:10 石榴海豹 阅读(81) 评论(0) 推荐(0)
摘要: import time scale=50 print("执行开始".center(scale//2,"-")) start=time.perf_counter() for i in range(scale+1): a='*'*i b='.'*(scale-i) c=(i/scale)*100 dur 阅读全文
posted @ 2020-10-19 20:01 石榴海豹 阅读(111) 评论(0) 推荐(0)