Skip to content

Checking if n == 0 should suffice #2

@karl-project-review

Description

@karl-project-review

if sum == 0 and n == 0:

First off, nice work ensuring we don't divide by zero here! However, since (a) we can assume sum == 0 if n == 0 and (b) we don't want to divide sum by 0 regardless of whether or not sum is in fact zero, we can forgo checking if sum == 0 here and just check if n == 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions