from itertools import permutations pw = "0123456789" c = permutations(pw, 3) #3 is the password length for i in c: current_pw = "".join(i) print(current_pw)