Separate elements from a sublist

-1

I have a question about how to separate elements within a sublist, each term. For example within my list one of its elements is:

A-82899, RESEARCH AND DOCUMENTATION TECHNIQUES, SOLORZANO DE NAN NAYETH., ESPOL, IBM4381,2003,8 / 22 / 2013,8, FCNM

that is my element with index 0 on my list, what I want is to be able to separate that element by commas, that is: '' A-82899 ',' RESEARCH TECHNIQUES .'... 'and so on.

    
asked by Sebastian Silva 21.01.2018 в 18:38
source

1 answer

0

def hh ():

a=['A-82899,TECNICAS DE INVESTIGACION Y DOCUMENTACION,SOLORZANO DE NAN NAYETH.,ESPOL,IBM4381,2003,8/22/2013,8,FCNM']

qq=[]
for i in a[0]:
    if i==',':
        m+=1
    elif i!=',':
        h=e[m]+i
        e.append(h)
w=[]
for i in a[0]:
    w.append(i)
x=(' ')
for i in w:
    if i!=',':
        z=i
        x=x+z
    elif i==',':
        qq.append(x)
        x=(' ')
print(qq)

hh ()

    
answered by 23.01.2018 в 05:52