About 161,000 results
Open links in new tab
  1. 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 = …

  2. 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 …

  3. python - How to generate a random string with symbols - Stack Overflow

    Nov 2, 2017 · To generate a random string we need to use the following two Python modules. String module which contains various string constant which contains the ASCII characters of all cases.

  4. What's the best way to generate random strings of a specific length in ...

    Don't forget to read this page about the default random number generator in python. The chance of collisions seems to be fully dependent on the size of the "random strings", but that does not mean …

  5. python - How to generate a random string - Stack Overflow

    Jun 7, 2016 · I'm trying to do a code where is generates a random string, but I have only just started coding so I don't want anything to the code to be too complicated. import random, string randomthing …

  6. 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 ...

  7. 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:

  8. python - Generating random text strings of a given pattern - Stack …

    Dec 15, 2008 · I need to generate random text strings of a particular format. Would like some ideas so that I can code it up in Python. The format is <8 digit number><15 character string>.

  9. python - Most lightweight way to create a random string and a …

    May 6, 2010 · What is the most lightweight way to create a random string of 30 characters like the following? ufhy3skj5nca0d2dfh9hwd2tbk9sw1 And an hexadecimal number of 30 digits like the followin?

  10. How do I generate a random string (of length X, a-z only) in Python?

    Oct 17, 2016 · Possible Duplicate: python random string generation with upper case letters and digits How do I generate a String of length X a-z in Python?