python, my first cod

2023-01-31 03:01:33 python cod

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


相关文章