matplotlib.pylab中文顯示 import matplotlib.pyplotas plt #解決中文的圖表顯示 from matplotlib.pylabimp...
matplotlib.pylab中文顯示 import matplotlib.pyplotas plt #解決中文的圖表顯示 from matplotlib.pylabimp...
1、雙坐標圖 # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt year = [2001,2002,2003,2...
1、柱狀圖 import matplotlib.pyplotas plt x = [2001,2002,2003,2004,2005] y = [1,3,2,4,3] #柱狀...
大寫,小寫,首字母大寫 word="Hello Eric, would you like to learn some Python today?" print(word) p...
# -*- coding: utf-8 -*- import randomas r def doit(n): for iin range(n): a =set() while...
常規(guī)矩形詞云 #GovRptWordCloudv1.py importjieba importwordcloud f=open("新時代中國特色社會主義.txt","r",e...
#AutoTraceDraw.py importturtleast t.title('自動軌跡繪制') t.setup(800,600,0,0) t.pencolor("re...
Hamlet詞頻統(tǒng)計(含Hamlet原文文本) #CalHamletV1.py defgetText(): txt=open("hamlet.txt","r").read()...
#CalStatisticsV1.py defgetNum():#獲取用戶不定長度的輸入 nums=[] iNumStr=input("請輸入數(shù)字(回車退出):") whil...
科赫曲線繪制源代碼 #KochDrawV1.py importturtle defkoch(size,n): ifn==0: turtle.fd(size) else: fo...
七段數(shù)碼管版本一 #SevenDigitsDrawV1.py importturtle defdrawLine(draw):#繪制單段數(shù)碼管 turtle.pendown()...
Π值的運算(蒙特·卡羅方法) 蒙特·卡羅方法(MonteCarlomethod),也稱統(tǒng)計模擬方法 #CalPI.py from random import random f...
BMI等級判斷 #CalBMI.py try: h,w = eval(input("input hight(cm) and weight(kg):")) except: pr...