#functions for alternating between lists and strings.
def numstring_to_list(string):
return [int(x) for x in list(string)]
def multi_numstring_to_list(*strings):
numlist = []
for s in strings:
for x in s:
numlist.append(int(x))
return numlist
def numlist_to_numstring(list):
return ''.join([str(x) for x in list])
def multi_numlist_to_string(*lists): #arbitrary number of lists to string
mergedlist = []
for l in lists:
for x in l:
mergedlist.append(str(x))
return ''.join(mergedlist)
def break_string_into_list(string, length):
#breaks a string into segments of the desired length into a list
start, end, strlist = 0, length, []
while end < len(string):
strlist.append(string[start:end])
start, end = end, end + length
return strlist