× New Paste
Welcome to Amin Mahmoudi official website.
Last Blog Posts :
How to connect PHP to Microsoft SQL Server Our Private World of Warcraft Fun 3.3.5a Server Started Install GCC7 in CentOS & Ubuntu Use Telegram bot to get notifications about your MasterkinG account Unveiling new version of MasterkinG32 website 
Main Menu
User Panel
  Guest - 2018/11/17 18:34 - Views : 101 -  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)