'Subset dictionary for keys starting with string

How to get the mydict subset for keys starting with/containing 'two' string?

mydict = {'one,a': 1, 'one,b': 2, 'two,a': 3, 'two,b': 3}

{'two,a': 3, 'two,b': 3}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source