Did i debug this code correctly?

Cameron Simpson cs at cskk.id.au
Wed Sep 21 17:54:45 EDT 2022


Preamble: this list strips attachments. If you attached some screenshots 
orfile attachments, we do no receive them. We generally don't like 
screenshots unless they're vital to demonstrating some visual thing. We 
_much_ prefer text pasted inline in the message.

So the below is written about a message with no attachments.

On 21Sep2022 05:49, tripd... at gmail.com <tripdarlinq at gmail.com> wrote:
>I am trying to solve this job task given to my girlfriend and here's the task and what i did
>
>~ The two Python functions liDDA and liB are supposed to solve the same task. Firstly, explain
>the task clearly and then fix any semantic errors in the two algorithms (so that they actually do
>solve the task correctly).

Well, as near as I can tell you've not explained the task. It isn't 
apparent to me what the purpose of either function is. I can see what 
they _do_, but I have no idea why.

Without knowing the intended task, it is impossible to "fix" either of 
them because we don't know what the "correct" behaviour should be.

>#Suppose you have found the following (incomplete) Python code on a scrap
>#The two Python functions are not quite finished and contain some errors.
>-Firstly, give a detailed critique of the incomplete Python code given above. Secondly, fix any syntax errors so that the Python code runs, ensure the code follows good Python coding style and improve all the variable and function names.

I don't see any critique either.

What I do see is no comments or docstrings. That would be the first 
thing I would want to change, probably followed by more expressive 
variable names.

BTW, the second function contains a syntax error, and would not run.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list