Hi friends!

I need to make a function which takes a string, e.g: '(239..247),(467..765)' (corresponding to the coding area of DNA sequence) and return a list with a tuple for each coding part, each with a start and end value. e.g. [(239,247),(267,765)]. Someone has a clue how to start up?

>>> list(eval('(239..247),(467..765)'.replace('..', ',')))
[(239, 247), (467, 765)]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.