Mar-17-2019, 02:30 PM
Maybe I am missing something but from documentation: random.randrange
Why
Quote:random.randrange(stop)
/../
Return a randomly selected element from range(start, stop, step).
Why
random.randrange(0, random_characters + 1)
and not justrandom.randrange(len(alphabet))
. Latter will give random number which is in range of valid indexes:>>> a = [1, 2, 3] >>> len(a) 2 >>> max(random.randrange(0, len(a) + 1) for x in range(100)) 3 >>> max(random.randrange(len(a)) for x in range(100)) 2 >>> a[3] Index Error /../
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.