Getting death row inmates' last statement
Types
Here:
def clean(first_and_last_name: list) -&gt; str:

list should more specifically be List[str].
Fluent syntax
Consider using fluent syntax for your clean, which - in this case - is basically just a reformat:
    return (
        &quot;&quot;.join(first_and_last_name)
        .replace(&quot; &quot;, &quot;&quot;)
        .replace(&quot;, Jr.&quot;, &quot;&quot;)
        .replace(&quot;, Sr.&quot;, &quot;&quot;)
        .replace(&quot;'&quot;, &quot;&quot;)
        .lower()
    )