- 博客(11)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 第一个程序
这是我的第一个程序import randomsecret = random.randint(1, 100)guess = 0tries = 0print "AHOY! I'm the Dread pirate Roberts, and I have a secret!"print "It is a number from 1 to 99. I'll giv
2016-12-11 17:41:04
427
2
原创 迭代
for i in "jhcjdj": print (i)s = "eiokod"it = iter (s)while True: try: each = next(it) except StopIteration: break print(each)
2017-09-17 12:39:53
253
转载 转换温度
print "This program converts Fahrenheit to Celsius"print "Type in a temperature in Fahrenheit: ",fahrenheit = float(raw_input())celsius = (fahrenheit - 32) * 5.0 / 9print "That is",print celsius,
2017-05-13 19:16:33
312
原创 类
class cuiyunhao(object): "kfdjdkfokckllddl" cuiyunhao = 9 def chi(self): print "wo ai chi"class pangping(object): laimo = 19 def lai(): print "wo jiu lai mo,za di
2017-05-13 18:27:31
280
原创 sprite类
import pygameclass myballclass(pygame.sprite.Sprite): def __init__(self, image_file, location): pygame.sprite.Sprite.__init__(self) self.inage = pygame.image.load(image_file)
2017-03-05 15:38:48
844
原创 艺术
import pygame, sys, randompygame.init()screen = pygame.display.set_mode([640, 480])screen.fill([255,255,255])for i in range (100): width = random.randint(0, 250) height = random.randint(0,
2017-02-14 17:55:45
263
1
原创 画圆
import pygame, syspygame.init()screen = pygame.display.set_mode([640, 480])screen.fill([255,255,255])pygame.draw.circle(screen, [200,15,0],[100,100], 30, 0)pygame.display.flip()while True: f
2017-02-12 18:53:30
297
原创 ball
class Ball: def bounce(self): if self.direction == "down": self.direction = "up"myBall = Ball()myBall.direction = "down"myBall.color = "small"myBall.size = "small"prin...
2017-02-08 16:57:00
273
原创 新程序
import easyguikey = 15guess = 0tries = 0easygui.msgbox("""1+2+3+4+5=?""")while guess != key and tries < 3: guess = easygui.integerbox("what") if not guess: break elif guess !
2017-02-08 14:10:42
386
1
原创 修改的程序
这是我对第一个程序的修改import random, easyguisecret = random.randint (1, 30)guess = 0tries =0easygui.msgbox("""AHOY! I'm the Dread pirate Roberts, and I hawe a secret!it is a number from 1 to 3
2017-01-09 13:19:41
385
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人