0

I'm trying to make a program that generates random credit card details. I don't know how to generate a random expiry date for the card and the expiry date should be expiry>current year.

Any help is appreciated.

Kunnu語
  • 25
  • 3
  • Maybe take a look [here](https://stackoverflow.com/questions/553303/generate-a-random-date-between-two-other-dates) – nikpau May 18 '22 at 12:23
  • Can you show some code and give us some more pieces of information. – codester_09 May 18 '22 at 12:23
  • @nikpau kind of because a cc lasts 3 to 4 years. So it should kind of be like a date between 2022 and 2027 and it should give output like this. Example: `06/26`. It shouldn't give date only print month and year. IDK if this makes sense sorry – Kunnu語 May 18 '22 at 12:32
  • @Sailesh語 Just define the `random_date()` function as `def random_date(start, end, prop): return str_time_prop(start, end, '%m/%y', prop)` and then call it with for example `print(random_date("1/08", "8/22", random.random()))` – nikpau May 18 '22 at 12:43

0 Answers0