python, my first cod

2020-01-08 16:35:13 浏览数 (1)

# 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"

0 人点赞