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...
常规矩形词云 #GovRptWordCloudv1.py importjieba importwordcloud f=open("新时代中国特色社会主义.txt","r",e...
#AutoTraceDraw.py importturtleast t.title('自动轨迹绘制') t.setup(800,600,0,0) t.pencolor("re...
Hamlet词频统计(含Hamlet原文文本) #CalHamletV1.py defgetText(): txt=open("hamlet.txt","r").read()...
#CalStatisticsV1.py defgetNum():#获取用户不定长度的输入 nums=[] iNumStr=input("请输入数字(回车退出):") whil...
科赫曲线绘制源代码 #KochDrawV1.py importturtle defkoch(size,n): ifn==0: turtle.fd(size) else: fo...
七段数码管版本一 #SevenDigitsDrawV1.py importturtle defdrawLine(draw):#绘制单段数码管 turtle.pendown()...
Π值的运算(蒙特·卡罗方法) 蒙特·卡罗方法(MonteCarlomethod),也称统计模拟方法 #CalPI.py from random import random f...
BMI等级判断 #CalBMI.py try: h,w = eval(input("input hight(cm) and weight(kg):")) except: pr...