About 87,400 results
Open links in new tab
  1. How exactly does random.random() work in python? - Stack …

    Feb 2, 2017 · The random module in python contains two interfaces (classes) of pseudorandom number generators (PRNGs). You can view it as two ways to generate random numbers.

  2. python - How can I randomly select (choose) an item from a list …

    As of Python 3.6 you can use the secrets module, which is preferable to the random module for cryptography or security uses. To print a random element from a list:

  3. Generate a random letter in Python - Stack Overflow

    Is there a way to generate random letters in Python (like random.randint but for letters)? The range functionality of random.randint would be nice but having a generator that just outputs a …

  4. How to generate random strings in Python? - Stack Overflow

    Mar 17, 2022 · How do you create a random string in Python? I need it to be number then character, repeating until the iteration is done. This is what I created: def random_id(length): …

  5. What does `random.seed()` do in Python? - Stack Overflow

    random.seed(a, version) in python is used to initialize the pseudo-random number generator (PRNG). PRNG is algorithm that generates sequence of numbers approximating the …

  6. Python Random Function without using random module

    Feb 25, 2015 · I need to write the function - random_number (minimum,maximum) Without using the random module and I did this: import time def random_number (minimum,maximum): now …

  7. python - Random is barely random at all? - Stack Overflow

    47 Before blaming Python, you should really brush up some probability & statistics theory. Start by reading about the birthday paradox By the way, the random module in Python uses the …

  8. python - Random int without importing 'random' - Stack Overflow

    Apr 9, 2014 · This will generate a list of uniformly distributed pseudo-random numbers between 0 and 1. Like the random number generators in random and numpy the sequence is fully …

  9. python - random.randint error: "AttributeError: 'module' object has …

    You should change any filenames random.py to something else. After this, "import random" will resolve to the "actual" random.py module and you will successfully use randint or any other …

  10. python - How to get random Decimal number from range? - Stack …

    Dec 5, 2016 · The question is a duplicate and this answer is a duplicate from that thread: This is fine for Python 3, however, OP is using Python 2 in which / is integer division. The result will …