def remove_line_comment(line: str) -> str:
    """Finds and erases Python style line comments, stripping any leading/trailing whitespace."""
    split_pos = line.find("#")
    if split_pos != -1:
        clean_line = line[:split_pos]
    else:
        clean_line = line
    return clean_line.strip()