"""Run the copycat program"""
import logging
import sys

from . import copycat


def main(program, args):
    """Run the program"""
    logging.basicConfig(
        level=logging.WARN, format="%(message)s", filename="./copycat.log", filemode="w"
    )

    try:
        if len(args) == 4:
            initial, modified, target = args[:-1]
            iterations = int(args[-1])
        else:
            initial, modified, target = args
            iterations = 1
        answers = copycat.run(initial, modified, target, iterations)
        for answer, d in sorted(answers.items(), key=lambda kv: kv[1]["avgtemp"]):
            print(
                f"{answer}: {d['count']} "
                f"(avg time {d['avgtime']}, avg temp {d['avgtemp']})"
            )
        return 0
    except ValueError:
        print(f"Usage: {program} initial modified target [iterations]", file=sys.stderr)
        return 1


if __name__ == "__main__":
    sys.exit(main(sys.argv[0], sys.argv[1:]))

@@ -87,21 +87,8 @@
 ain(
-program, args
 ):%0A 
@@ -233,16 +233,46 @@
 %0A    )%0A%0A
+    program, *args = sys.argv%0A
     try:
@@ -969,32 +969,7 @@
 ain(
-sys.argv%5B0%5D, sys.argv%5B1:%5D
 ))%0A

Remove redundant arguments