First, you should replace the photos in your post with a copy-paste of the code, ideally surrounded by
``` (markup indicating a code block).
Second, combine the second post into the first.
Third, check out the pytest documentation on input/output to automate passing user input.
Fourth, try de-denting your
return statement once.
Let me do that. Thanks.