摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #画个笑脸 from graphics import * win = GraphWin() face = Circle(Point(100,95), 50) leftEye = Circle(Point(80,80) , 5) leftEye.setFill("yellow") leftEye.set... 阅读全文
posted @ 2017-11-16 18:08 hayden__wang 阅读(459) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*-#温度转换 from graphics import * win = GraphWin("摄氏温度转换器", 400, 300) win.setCoords(0.0, 0.0, 3.0, 4.0) # 绘制接口 Text(Point(1,3), " 摄氏温度:").draw(win) Text(Poi... 阅读全文
posted @ 2017-11-16 15:12 hayden__wang 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 面向对象程序设计的基本步骤: 第一步:根据功能,抽象业务对象 第二步:构建独立的业务模块,利用封装、继承、多态等抽象业务需求 第三步:编写程序 第四步:以对象为单位输入参数、开展测试 阅读全文
posted @ 2017-11-16 11:36 hayden__wang 阅读(401) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #shotput.py from math import pi,sin,cos,radians def main(): angle = eval(input("输入发射角度 (以度为单位):")) vel = eval(input("输入初始速度(以米/秒为单位):")) ... 阅读全文
posted @ 2017-11-16 11:15 hayden__wang 阅读(256) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #matchSim.py from random import * def main(): printIntro() probA,probB,n = getInputs() winsA, winsB = simNGames(n,probA,probB) PrintS... 阅读全文
posted @ 2017-11-16 10:33 hayden__wang 阅读(329) 评论(0) 推荐(0) 编辑