设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
楼主: crossin先生
打印 上一主题 下一主题

【Python 第14课】 字符串格式化

[复制链接]

1

主题

0

好友

23

积分

新手上路

Rank: 1

楼主
发表于 2018-4-11 16:32:49 |显示全部楼层
from random import randint
num=randint(1,100)
print('guess what is think')
bingo=False

while bingo== False:
    answer=int(input())

    if int(answer) < num:
        print ('%s is too small'%answer)
        
    if int(answer)>num:
        print('%s is too big!'%answer)

    if int(answer)==num:
        print('BINGO!,%s is the right'%answer)
        bingo=True
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-5-17 20:12 , Processed in 0.027300 second(s), 24 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部