摘要:
一、BP神经网络算法 import pandas as pd import numpy as np #导入划分数据集函数 from sklearn.model_selection import train_test_split #读取数据 datafile = 'C:/Users/Desktop/8 阅读全文
摘要:
import requests from bs4 import BeautifulSoup import csv import pandas as pd allUniv=[] def getHTMLText(url): try: r=requests.get(url,timeout=30) r.ra 阅读全文
摘要:
from PIL import Image import numpy as np a = np.asarray(Image.open('D:/anaconda/learning note/7e5829bdcefae7d1.jpg').convert('L')).astype('float') de 阅读全文
摘要:
import random def printIntro(): print("moniA and B") def getInputs(): a = eval(input("please input A socre(0~1):")) b = eval(input("please input B soc 阅读全文
摘要:
1 n=input("输入汉诺塔碟子总数") 2 def move(n,a,b,c): 3 if n==1: 4 print(a,'->',c) 5 else: 6 move(n-1,a,c,b) 7 move(1,a,b,c) 8 move(n-1,b,a,c) 9 10 动图: 11 impor 阅读全文
摘要:
Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 turtle绘图的基础知识:1. 画布(canvas) 画布就是turtle为 阅读全文
摘要:
1 import time 2 scale=50 3 print("执行开始".center(scale//2,"-")) 4 start=time.perf_counter() 5 for i in range(scale+1): 6 a='*' *i 7 b='·' *(scale-i) 8 c 阅读全文
摘要:
1 ss = input() 2 t = "" 3 for i in ss: 4 if 'a' <= i <= 'z': 5 t += chr( ord('a') + ((ord(c)-ord('a')) + 3 )%26 ) 6 elif 'A'<=c<='Z': 7 t += chr( ord( 阅读全文
摘要:
1 import turtle as t 2 t.seth(60) 3 for i in range(3): 4 t.right(120) 5 t.fd(200) 6 t.right(120) 7 t.fd(100) 8 t.right(120) 9 for i in range(3): 10 t. 阅读全文
摘要:
import turtle as t t.penup() t.fd(-100) t.pendown() t.seth(30) for i in range(3): t.fd(120) t.right(120) t.fd(40) t.left(60) t.fd(40) t.seth(-30) for 阅读全文