dimanche 9 mai 2021

trying to generate random number the program runs but jumps over to the next function without generating the number

# print("Hello, Dcoder!")

import random

database = {}


def init():
    print("welcome to FirstBank")

    have_account = int(input("do you have an account with us: 1(yes) 2(no)\n"))

    if have_account == 1:
        login()

    elif have_account == 2:
        register()

    else:
        print("you have selectrd invalid option")


def login():
    print("xxxxxx login xxxxxx")

    account_number = int(input("what is your account number?\n"))

    password = input("what is your password\n")

    for account_number, user_details in database.items():

        if (account_number == account_number_from_user):
            bank_operations(user_details)

    else:

        print("invalid account or password")

    login()


def register():
    print("xxxx register xxxx")

    email = input("what is your email address?\n")
    first_name = input("what is your first name?\n")
    last_name = input("what is your last name?\n")
    password = input("create password\n")
    account_number = generation_account_number()
    database[account_number] = [first_name, last_name, email, password]
    login()


def generation_account_number():
    return random.randrange(1111111111, 9999999999)


init()



Aucun commentaire:

Enregistrer un commentaire