passw import random def passGen countChrs arr for in range countChrs p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#passw=''
import random
def passGen(countChrs=8):
arr = ['q','w','e','r','t','y','u','i','o','p',
'a','s','d','f','g','h','j','k','l','1','2','3',
'4','5','6','7','8','9','0','z','x','c','v','b',
'n','m',' ','F','G','R','T']
# for i in range(0,countChrs):
# passw+=str(random.choise(arr))
return "".join(random.sample(arr,countChrs))
#call def
print( passGen(10) ) # 1..10
print( passGen() ) # 1..8