首页 > 代码库 > python, my first code

python, my first code

# coding:utf-8

from random import randint

num=randint(1,100)

print "guess the right number ,so please input a number:"

a=1

while a==1:

    answer=input() ##把输入赋值给answer以便条件中用到比较大小


    if answer<num :

         print "it‘s too small"

    if answer>num :

         print "it‘s too big"

    if answer==num :

         print "right"


本文出自 “飞舞的青春” 博客,转载请与作者联系!

python, my first code