Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    For example (d > 2) cam either eavaluate to True or False, which is 1 or 0 in Python so s/he can then use that result in the calculation. Technically, I think, it's a bad idea to mix types like this (i.e. boolean and integer) but Python has this feature where boolean is a subtype of integer so it's perfectly acceptable. I've never studied programming so please excuse me if this nonsensical.

  • Custom User Avatar

    Given a base number and a possible factor, you have to check if the division's resulting remainder is 0.

    You can use the mod operator (%) in most languages to check for a remainder
    If the remainder is 0 then the number is a factor.

    For example:

    3 is a factor of the base number 6 because the operation (6 % 3) returns a remainder of 0.

    2 is not a factor of 7 because: 7 % 2 = 1