随笔分类 -  Python

摘要:这是在coursera上面的一门学习pyhton的基础课程,由RICE的四位老师主讲。生动有趣,一共是9周的课程,每一周都会有一个小游戏,经历一遍,对编程会产生很大的兴趣。 所有的程序全部在老师开发的在线平台进行测试,并且还有“VIZ mode”,可以通过可视化的模式,理解程序的进程。This c... 阅读全文
posted @ 2014-11-06 09:58 同叔练级之路 阅读(283) 评论(0) 推荐(0)
摘要:Question 8We can use loops to simulate natural processes over time. Write a program that calculates the populations of two kinds of “wumpuses” over ... 阅读全文
posted @ 2014-11-01 16:55 同叔练级之路 阅读(232) 评论(0) 推荐(0)
摘要:Question 7Convert the following English description into code.Initializento be 1000. Initializenumbersto be a list of numbers from 2 to n, but not i... 阅读全文
posted @ 2014-11-01 16:53 同叔练级之路 阅读(420) 评论(0) 推荐(0)
摘要:First, complete the following class definition:class BankAccount: def __init__(self, initial_balance): """Creates an account with the give... 阅读全文
posted @ 2014-10-31 13:46 同叔练级之路 阅读(318) 评论(0) 推荐(0)
摘要:pyton 程序内容的颠倒,运用 [](列表)def reverse_string(s): """Returns the reversal of the given string.""" result = "" for char in s: result = char... 阅读全文
posted @ 2014-10-22 20:35 同叔练级之路 阅读(158) 评论(0) 推荐(0)
摘要:import simpleguiimport math# global variablesball_pos = [50,50]ball_radius = 12ball_color = 'red'# help fuctions# classes# define event handlers # ... 阅读全文
posted @ 2014-10-22 14:26 同叔练级之路 阅读(160) 评论(0) 推荐(0)
摘要:Mini-project description — Rock-paper-scissors-lizard-SpockRock-paper-scissors is a hand game that is played by two people. The players count to three... 阅读全文
posted @ 2014-10-18 14:58 同叔练级之路 阅读(376) 评论(0) 推荐(0)
摘要:Mini-project #4 - "Pong"In this project, we will build a version ofPong, one of the first arcade video games (1972). While Pong is not particularly ex... 阅读全文
posted @ 2014-10-18 14:31 同叔练级之路 阅读(582) 评论(0) 推荐(0)
摘要:# Ball motion with an explicit timerimport simplegui# Initialize globalswidth = 600height = 600ball_pos = [width/2, height/2]ball_radius = 20ball_vel ... 阅读全文
posted @ 2014-10-18 10:53 同叔练级之路 阅读(165) 评论(0) 推荐(0)
摘要:# Ball motion with an explicit timerimport simplegui# Initialize globalswidth = 600height = 600ball_pos_init = [width/2, height/2]ball_radius = 20ball... 阅读全文
posted @ 2014-10-18 10:21 同叔练级之路 阅读(136) 评论(0) 推荐(0)