This program is written in Python and it performs the following operations:
l = ["TjC","TjCpp","TjPython","Java","tj"] print("The original list is : ",l) pref = "Tj" res = [] for val in l: if val.startswith(pref): res.append([val]) else: res[-1].append(val) print("Prefix Split List : " + str(res))
The original list is : ['TjC', 'TjCpp', 'TjPython', 'Java', 'tj'] Prefix Split List : [['TjC'], ['TjCpp'], ['TjPython', 'Java', 'tj']]
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions