[Solved] How do i parse a list in this format in python something:some07therthing:another thiing? [duplicate]


You probably don’t need regular expressions for this:

line = "2020:turquoise"
year,color = line.split(":")

line = "2021:red:notagoodyear"
year,color,comment = line.split(":")

solved How do i parse a list in this format in python something:some07therthing:another thiing? [duplicate]