**Background**

I am trying to ensure I am generating a unique `credit card number`. The `credit card number` needs to be **16 digits long** with the last digit equal to the `checksum` which in this case is `self.checksum = 1`.

The first 6 digits of the `credit card number` must be `400000`.

Since the last digit must be equal to the `checksum` or `1` in this case, I believe I need to implement a range in my code somehow to indicate when the `maximum credit card number has been issued.` In this case, the maximum `credit card number` is `40000009999999991`. Anything after that would change the first 6 digits.

While the current solution "works" it does so by only adding `10` to the first possible `credit card number` initialized in the `__init__` as `self.credit_card_number = 4000000000000001`.

**Help needed**

I am looking for help taking my existing code and implementing a range of some sort that can alert when the last `credit card number` in the range has been issued.

```py
from random import randrange

class Accounts:
    def __init__(self):
        self.accounts_list = []
        self.all_accounts = dict()
        self.balance = 0
        # Initial credit card number
        self.credit_card_number = 4000000000000001
        # Checksum is the last digit (16th) in the credit card number.
        self.checksum = 1
        # Pin number is generated in account_creation
        self.pin = None

    def main_menu(self):
        while True:
            main_menu_choice = input('1. Create an account\n'
                                     '2. Log into account\n'
                                     '0. Exit\n')
            if main_menu_choice == '1':
                self.account_creation()

    def account_creation(self):
        # Create credit card number ensuring it is unique by adding 1 to initialized value.
        if len(self.accounts_list) == 0:
            self.credit_card_number = self.credit_card_number
        else:
            self.credit_card_number = self.credit_card_number
            self.credit_card_number = self.credit_card_number + 10
        # Create pin number.
        pin = int(format(randrange(0000, 9999), '04d'))
        # Add credit card number to list used in the above if statement.
        self.accounts_list.append(self.credit_card_number)
        # Add the credit card number, pin, and balance to dictionary.
        self.all_accounts[self.credit_card_number] = {'pin': pin, 'balance': self.balance}
        # Print the output to make sure everything is OK.
        print(self.accounts_list)
        # Print the output to make sure everything is OK.
        print(self.all_accounts)
        print(f'\n'
              f'Your card has been created\n'
              f'Your card number:\n'
              f'{self.credit_card_number}\n'
              f'Your card PIN:\n'
              f'{pin}'
              f'\n')

Accounts().main_menu()

```