鱼C论坛

 找回密码
 立即注册
查看: 18101|回复: 5

randint() missing 1 required positional argument: 'b'

[复制链接]
发表于 2018-10-18 11:57:37 | 显示全部楼层
import random
secret= random.randint(1,10)
times=3
temp=input("请您从1-10中人任选一个数猜一猜:")
guess=int(temp)
while (guess != secret) and (times > 0):
    if guess > secret:
        print("大了!")
    else:
        print("小了!")
    times=times-1
    if times > 0:
        print("您还有机会!")
        temp=input("请再猜测一次:")
        guess=int(temp)
    else:
        print("机会用完!")   

if times>0:
    print("对了")
else:
    print("结束")
         
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-9-24 11:09

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表