Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ff1099 commit 63b1767Copy full SHA for 63b1767
1 file changed
Lib/random.py
@@ -634,9 +634,9 @@ def getrandbits(self, k):
634
raise ValueError('number of bits must be greater than zero')
635
if k != int(k):
636
raise TypeError('number of bits should be an integer')
637
- bytes = (k + 7) // 8 # bits / 8 and rounded up
638
- x = int.from_bytes(_urandom(bytes), 'big')
639
- return x >> (bytes * 8 - k) # trim excess bits
+ numbytes = (k + 7) // 8 # bits / 8 and rounded up
+ x = int.from_bytes(_urandom(numbytes), 'big')
+ return x >> (numbytes * 8 - k) # trim excess bits
640
641
def seed(self, *args, **kwds):
642
"Stub method. Not used for a system random number generator."
0 commit comments