zoukankan      html  css  js  c++  java
  • day10

    在猜年龄的基础上编写登录、注册方法,并且把猜年龄游戏分函数处理,如

    1. 登录函数
    2. 注册函数
    3. 猜年龄函数
    4. 选择奖品函数

    登录函数

    def login():
        """登录功能"""
    count = 0
    while count < 3
        username_inp = input('请输入用户名')
        pwd_ino = input('请输入密码')
        if username.strip()  == username_inp and pwd.strip () == pwd_inp
            print('登录成功')
        else:
            continue
    else:
        print('登录失败')
        break
    

    注册函数

    def register():
        """注册功能"""
    count = 0
    while count < 3
        username_inp = input('请输入用户名')
        pwd_ino = input('请输入密码')
        re_pwd_inp = input('请再次输入密码')
        if not pwd_inp ==re_ped_inp
            print('密码错误')
        else:
            print('密码正确')
            count += 1
            break
    

    猜年龄函数

    count = 0
    while count < 3
        age = 18
        age_inp_int = input('请输入年龄')
        if not age_inp_int < age :
            print9('猜小了')
            if not age_inp_int > age :
                print('猜大; ')
        else:
            print('正确')
            count += 1
            break
    

    选择奖品函数

    prize_dict={'0':"比蒂"
                '1':'psp''2':"手办"'3':"手机"}
    prize_choice = input('请选择;prize_dict')
    print('恭喜prize_choice')
    count = 0
    while count < 2
        print(f'奖品如下:{prize_dict}')
    prize_choice = input('请选择')
    print{f'prize_dict[prize_choicec}'}
    count += 1
    break
    
    
  • 相关阅读:
    RequireJS进阶(二)
    JavaScript判断元素为数字的奇异写法
    RequireJS进阶(三)
    RequireJS进阶(一)
    读Ext之十四(Ext元素)
    JavaScript中__proto__与prototype的关系
    工作流术语
    一个例子(Hello World)
    无题
    再谈调用子流程(1)
  • 原文地址:https://www.cnblogs.com/yu521/p/11552285.html
Copyright © 2011-2022 走看看