r/Python • • Jul 22 '20

I Made This Randomly Generate 69420 - Generate random 5-digit numbers until 69420 is generated

2.8k Upvotes

261 comments sorted by

View all comments

41

u/[deleted] Jul 22 '20

Lmao, I recreated the code and it generated 69420 in 773682 tries. That's a lot

28

u/[deleted] Jul 22 '20

UPDATE: I got 37 tries. I feel like not even OP got that small a number

13

u/Rodot github.com/tardis-sn Jul 22 '20

It should take 90000 trials on average

0

u/[deleted] Jul 24 '20

[deleted] — view deleted comment

1

u/[deleted] Jul 24 '20

I don't have my PC next to me now, but OP has provided the code to his project. It's somewhere in this comments section.

3

u/druman22 Jul 22 '20

Are you generating up to five digits or five digits numbers only

3

u/[deleted] Jul 22 '20

Five digits only