Skip to content

question with regards to week1/max_pairwise_product.py #1

@annabechang

Description

@annabechang

Hi,

With regards to week1/max_pairwise_product.py
would you please explain what does "if max_index1 == -1" do in the if condition in the for loop?

since max_index1 is initially assigned to -1, why do we need that in the if loop again? I did test it and knew that the answer wouldn't be right without that condition, but I can't figure out why.
Thanks!

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