0

Can we set upper limit of random function to infinity, means that there is no upper limit for random() function and it sets its upper limit automatically from infinite numbers each time we use it.

If not random() function, is there any other function that can do this?

Muhammad Asim
  • 161
  • 2
  • 9
  • 1
    Would `random() * sys.maxsize` be ok ? – azro Sep 11 '21 at 07:36
  • check this https://stackoverflow.com/questions/35361811/how-to-generate-n-random-numbers-in-python-3-between-0-to-infinity – sittsering Sep 11 '21 at 07:37
  • You might have to wait a **very** long time to get an answer. How many billions do you have to buy more storage to hold the number when you eventually get it? – rossum Sep 11 '21 at 07:39

1 Answers1

0
import random
import sys
x = random.randint(0, sys.maxsize)
FLAK-ZOSO
  • 3,873
  • 4
  • 8
  • 28