Scala has the apply()
function.
I am new to Python and I am wondering how should I write the following one-liner:
(part_a, part_b) = (lambda x: re.search(r"(\w+)_(\d+)", x).groups())(input_string)
I would feel better with something like:
(part_a, part_b) = input_string.apply(lambda x: re.search(r"(\w+)_(\d+)", x).groups())
Am I wrong from a FF viewpoint? Is there such construction in Python?
Edit: I know about the poorly picked snippet.