Converting List to string in Python

Source code :

def list2str(data):
    r=''
    for x in data:
        r+=str(x)
    return r


list = ['C','o','d','e','C','r','y']
print(list2str(list))

Output :

CodeCry

Output :


                

Comments :