About 50 results
Open links in new tab
  1. How exactly does random.random() work in python? - Stack Overflow

    Feb 2, 2017 · The random () method is implemented in C, executes in a single Python step, and is, therefore, threadsafe. The _random is a compiled C library that contains few basic operations, which …

  2. Generate list of random names - Python - Stack Overflow

    I'm trying to create a list of names, with each one being different. Here is my code right now, but all it does it create multiple instances of the same name. import random first_names=('John','...

  3. 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 = str …

  4. python - How to make a random function without using any library ...

    Mar 5, 2023 · An example of a well-known algorithm which produces pseudo-random integer numbers, is simple enough to be programmed/understood by a beginner, and has quite good statistical …

  5. 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 Mersenne …

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

    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:

  7. python - Downloading Random.py Using Anaconda - Stack Overflow

    Apr 30, 2017 · The random module is part of the Python standard library. There is no need to install it separately.

  8. Random word generator- Python - Stack Overflow

    Using random.sample will provide you with a list of the total number of items (characters in this case) from the given object (a string object here) based on the number you want (random.sample …

  9. 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): number = …

  10. Get a random boolean in python? - Stack Overflow

    Jul 26, 2011 · I am looking for the best way (fast and elegant) to get a random boolean in python (flip a coin). For the moment I am using random.randint(0, 1) or random.getrandbits(1).