""" 抽奖系统 """ print("欢迎来到会员抽奖系统") userName = input("请输入用户名:") password = input("请输入密码:") num = [random.randint(1000,10000)for _ in range(10)]#随机生成十个整数,变成一个数组 #print(num) while True: while userName == "admin" and password == "123456": count = int(input("请输入四位会员号:")) while count >= 1000 and count < 10000: if count in num: print("恭喜你,中奖了!") exit()#退出程序 else: print("对不起没有中奖") exit() else: print("会员号格式错误!") continue#退出本次循环 else: userName = input(("用户名密码错误!请重新输入用户名:")) password = input("请输入重新输入密码:")
随机函数random小游戏——抽奖
最新推荐文章于 2022-05-24 21:30:04 发布