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

[ad_1]

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(":")

[ad_2]

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