29 lines
554 B
Python
29 lines
554 B
Python
|
import random
|
||
|
|
||
|
lower = "abcdefghijklmnopqrstuvwxyz"
|
||
|
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||
|
numbers = "0123456789"
|
||
|
symbols = "!$%&/?+*-#"
|
||
|
|
||
|
def genNum(length):
|
||
|
gen(numbers, length)
|
||
|
|
||
|
def genLetLow(length):
|
||
|
gen(lower, length)
|
||
|
|
||
|
def genLetUp(length):
|
||
|
gen(upper, length)
|
||
|
|
||
|
def genLet(length):
|
||
|
gen(lower + upper, length)
|
||
|
|
||
|
def genLetNum(length):
|
||
|
gen(lower + upper + numbers, length)
|
||
|
|
||
|
def genFull(length):
|
||
|
gen(lower + upper + numbers + symbols, length)
|
||
|
|
||
|
def gen(chars, length):
|
||
|
print(''.join(random.choice(chars) for _ in range(length)))
|
||
|
|