Guest - 2018/11/17 18:34 - Views : 4492 -
Python -
Clone -
RAW -
Download -
import re
array_input = ["a","b","c","d","e","3","4"]
array_lenght = len(array_input)
array_final = {}
def allstatesvar(width,position1,base_string,array_input):
global array_final
array_lenght = len(array_input)
for i in range(array_lenght):
if position1 < (width - 1):
new_value = base_string + array_input[i]
if re.match(r"^[0-9]+",new_value):
continue
allstatesvar(width, position1 + 1, new_value,array_input)
array_final[new_value] = new_value
for i in range(array_lenght):
if(allstatesvar(i, 0, "",array_input)):
break
print(array_final)