I am working on a project where I have to issue card to each and every account that has been created, below are the methods that I have to create within the class to have the card issued and with an expiry date as mentioned in the below criteria , we are not allowed to import anything beyond random or datetime method, we can use loops for same
cardNumber – The card number, which should be a string containing a 16-digit number ( should be importing and use the random module for this).
cardExperience - a tuple, where the first element is an integer corresponding to the month and the second element is 2-digit year. Eg: 03/23 represents March 2023. (should be importing and use the datetime module for this).
issueNewCard(self) Creates a new card number, with the expiry date being 3 years to the month from now (e.g., if today is 31/1/21, then the expiry date would be (01/24)).
def IssueNewCard(self): CardNumber = list(range(1000000000000000,9999999999999999)) IssuedCardNumber = random.sample(CardNumber) today=datetime.date.today("%y","%m") print(IssuedCardNumber) print(today)