Generation

generate functionFri, 23 Dec 2022

There is a list lst = '[0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1]' Glue it on one line without commas and spaces to get '01011110001100111'

def glue_list(lst): glue_string = '' for i in lst: glue_string += str(i) return glue_string print(glue_list([0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1]))

Questions about programming?Chat with your personal AI assistant