from random import choice
from string import ascii_letters, digits
ch = ascii_letters + digits
def randpass(n=8):
result = ”
for i in range(n):
ch1 = choice(ch)
result += ch1
return result
if name == ‘main‘:
print(randpass())
print(randpass(4))