
Python
山东馍馍
便宜、听话、能加班~
展开
-
Python-Pygal模拟掷骰子
from random import randint# 骰子类class Die(): def __init__(self, num_sides=6): # 骰子的面数 self.num_sides = num_sides def roll(self): # 模拟投骰子 return randint...原创 2019-03-23 14:58:04 · 1069 阅读 · 1 评论 -
Python-matplotlib随机漫步
from random import choiceclass RandomWalk: def __init__(self, num_points=1000): # 随机漫步的最大距离 self.num_poimts = num_points # 随机漫步的'脚步' self.x = [0] sel...原创 2019-03-23 14:21:07 · 388 阅读 · 0 评论 -
Python-matplotlib的使用简介
import matplotlib.pyplot as plt# 解决中文乱码问题plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号# 准备数据array = []for a in range(0, 5):...原创 2019-03-22 21:44:35 · 288 阅读 · 0 评论 -
Python-Tim Peters的Python之禅
The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Spars...原创 2019-02-18 20:02:18 · 1975 阅读 · 0 评论