About 54 results
Open links in new tab
  1. Python random function - Stack Overflow

    Feb 21, 2013 · The 'random' module is a package from the python standard library, as well as a function defined in this package. Using 'import random' imports the package, which you can then use the …

  2. Como gerar números aleatórios em Python?

    Jul 24, 2015 · Eu gostaria de saber como gerar números aleatórios em Python. Estou com a versão 3.4.

  3. python - What is the difference between FROM random IMPORT* and …

    When you from random import *, all the definitions from random become part of the current name space. This means you don't have to prefix anything with random., but it also means you may get a name …

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

    Though random.choice(tuple(some_set)) may be an option for getting a single item from a set. EDIT: Using Secrets As many have pointed out, if you require more secure pseudorandom samples, you …

  5. python - Random string generation with upper case letters and digits ...

    We import string, a module that contains sequences of common ASCII characters, and random, a module that deals with random generation. string.ascii_uppercase + string.digits just concatenates …

  6. Python "import random" Error - Stack Overflow

    19 By naming your script random.py, you've created a naming conflict with the random standard library module. When you try to run your script, the directory containing the script will be added to the start …

  7. Python: Random numbers into a list - Stack Overflow

    Computers programs in Python always do one thing at a time. Every program is a sequence of very tiny steps. Now, the question then becomes "What steps do I want completed when I print the list?". And …

  8. How do I get the 'random' module to work? Did I forget to import ...

    Aug 4, 2020 · You have to use random.random() like this. ... or you can import specific functions in random module like this.

  9. Generate random integers between 0 and 9 - Stack Overflow

    How can I generate random integers between 0 and 9 (inclusive) in Python? For example, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

  10. 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 random ...