自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 penalty kick

from random import choiceprint 'choose one direction to shoot:'print 'left right center\n'you=raw_input()print 'you choosed '+youprintdirection=['left','right','center']keeper=choice(direction)

2017-07-22 19:47:50 240

原创 bingo using function

def ifequal(num1,num2): if num1>num2: print 'too small' return False; elif num1<num2: print 'too big' return False; else: print 'bingo' return True##########top is a function##########

2017-07-22 18:16:00 159

原创 bingo update1

from random import randintnum=randint(0,100)print 'guess the number please'bingo=Falsewhile bingo==False: ans=input() if ans<num: print '%d is too small'%ans if ans>num:

2017-07-21 16:45:29 179

原创 variable

#==== 变量命名规则 ====#变量名不是你想起就能起的:第一个字符必须是字母或者下划线“_”剩下的部分可以是字母、下划线“_”或数字(0-9)变量名称是对大小写敏感的,myname和myName不是同一个变量。几个有效的栗子:   i   __my_name   name_23   a1b

2017-07-21 14:33:22 211

原创 random

from random import randintnum=randint(a,b)     a

2017-07-21 14:24:44 153

原创 python game1

num = 10                    #get the numberprint 'Guess what I think?'answer = input()             #input your answerwhile answer!=num:    if answer        print 'too small!'     #if...   

2017-07-21 10:38:45 153

原创 if

语法为:   if 条件:       选择执行的语句特别说明:条件后面的冒号不能少,同样必须是英文字符。特别特别说明:if内部的语句需要有一个统一的缩进,一般用4个空格。python用这种方法替代了其他很多编程语言中的{}。你也可以选择1/2/3...个空格或者按一下tab键,但必须整个文件中都统一起来。千万不可以tab和空格混用,不然就会

2017-07-21 10:07:22 195

原创 bool

>:大于>=:大于等于==:等于。比较两个值是否相等。之所以用两个等号,是为了和变量赋值区分开来。!=:不等与not:逻辑“非”。如果x为True,则not x为Falseand:逻辑“与”。如果x为True,且y为True,则x and y为Trueor:逻辑“或”。如果x、y中至少有一个为True,则x or y为True

2017-07-21 09:57:07 198

原创 python1~5

没想到整一个博客这么难用,,,,print('string')print'string'print"string"print numprint computationprint compareinput()raw_input()

2017-07-21 09:51:43 276

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除