← 返回题库
中级

实现支付密码验证错误次数锁定

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    account_types_csv = open_url(____).read()
    payment_channels_csv = open_url(____).read()
    transfer_types_csv = open_url(____).read()
    transaction_limits_csv = open_url(____).read()
    accounts_csv = open_url(____).read()
    transfers_csv = open_url(____).read()
    amount_reservations_csv = open_url(____).read()
    fraud_rules_csv = open_url(____).read()
    attempts, max_attempts, correct, locked = ____, ____, '____', False
    inputs = ['____', '____', '____', '____']
    for pwd in inputs:
        if locked:
            print(____)
            continue
        if pwd == correct:
            print(____)
            attempts = ____
        else:
            attempts += ____
            if attempts >= max_attempts:
                locked = True
                print(____)
            else:
                print(____)

示例

输入
solve()
期望输出
密码: wrong1  结果: FAIL (剩余2次)
密码: wrong2  结果: FAIL (剩余1次)
密码: 123456  结果: PASS
密码: wrong3  结果: FAIL (剩余2次)
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码