randomly generates eight digits with 26 English letter case and 0-9 to form
using module string and random.
“
” unpack string, list, dictionary front to add two “**”
import string
import random
sour = list(string.ascii_letters+string.digits)
print(*random.choices(sour, k=8))
div>
Read More:
- Python random selects elements randomly from a collection
- How to Split numbers and strings in a strings
- Greek letters in latex
- Python switch / case statement implementation method
- Implementation of Python switch / case statements
- python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: trunca
- Python: Understanding__ str__
- Python common error: if using all scalar values, you must pass an index (four solutions)
- Coding and decoding Base64 in Python
- Build your own resnet18 network and load torch vision’s own weight
- Methods of modifying index and columns names by dataframe in pandas
- Python TypeError: not all arguments converted during string formatting [Solved]
- Three methods of converting dict into dataframe by pandas
- Summary of three methods for pandas to convert dict into dataframe
- Parsing the exception of storing JSON string in cookie
- C / C + + library function (tower / tower) realizes the conversion of letter case
- Learn English together | three ways to realize digital factorial with JavaScript
- numpy.random.rand()
- Regular expressions filter special characters
- In Java, int is converted to string, and zero is added before the number of bits is insufficient