// Python
import string
import random
English string = string.ascii_letters
Numeric column = string.digits
String Length = 15
Password = ''
For i in range:
// I don't want to alternate numbers with English here, what should I do?
Password + = random.choice + random.choice
print (password)
English numerals, English numerals <- You want to prevent this from happening, right?
Try it as below.
In [1]: import string
In [2]: import random
In [3]: seedStr = string.ascii_letters + string.digits
In [4]: ''.join(random.choice(seedStr) for _ in range(15))
Out[4]: 'DNV0MBcQPj3tbmY'
In [5]: ''.join(random.choice(seedStr) for _ in range(15))
Out[5]: 'K3JJR8ZkzJ0AFZ9'
© 2024 OneMinuteCode. All rights reserved.