I want your help to catch an specific number or any number that I asked for in bool_check in this case that number is "4321" so i've been struggling to get True and also I want the program to show me that specific number from this set of permutations. For example, I want the output to say: True 4321 So far i got the permutations and the functions but i dont know how to connect everything. Thank you for your time.
from itertools import product
def bool_check(x):
if x == "4321":
return True
else:
return False
def find_key(diferent_dig, quantity_dig):
chars = list(diferent_dig)
perms = []
for c in product(chars, repeat = quantity_dig):
perms.append(c)
return perms
print(find_key("1234", 4))