Exercise 1 solution import re s = "Smith, John; Doe, Jane" pairs = re.findall(r"(\w+), (\w+)", s) print(pairs) # [('Smith', 'John'), ('Doe', 'Jane')] print([f"{b} {a}" for a, b in pairs]) # ['John Smith', 'Jane Doe'] (Both lines were run and printed exactly the lists shown.) Explanation: with two capturing groups, findall returns one tuple per match holding (group 1, group 2). Unpacking each tuple as "a, b" gives the surname and the first name, which can then be put in any order you like.