could you help me please?
I am trying to desing an algorithm that assings the syllable boundaries for any given string of consonanats and vowels 'CVCCVCCVCC'. These strings are stored in a list that may run into hundred of thousands or even million of itmes in length. However, it seems that I did not understand handling lists properly and that is why I am getting this trouble. After composing the code, I click "Run" the module, and Python shell restarts, raising no syntax error. However, when I test the code, it returns an empty list. The code is here. Could you please tell me what is the wrong with my algorithm? I am getting really disappointed.
Thanks in advance for kind help!
def assing_boundaries(L):
""" (List of str -> List of str)
Assings the syllable boundaries for a given string of Syllable Templates, with the output meeting the two conditions given below:
Condition1: item[2:] != 'CC'
Condition2: item[:-2] !='C.C'
>>> assing_boundaries(['CVCCVCC', 'CVCCV:C'])
['CVC.CVCC', 'CVC.CV:C']
"""
boundary = []
i = 0
for item in L:
for char in item:
for i in range(len(item) - 1):
if item[i] == 'CC':
char = 'C.C'
i = i + 1
boundary = boundary.append(item)
return boundary