Ad
  • Custom User Avatar

    Yes, I'll try to arrange this a bit but in the very first lines (3rd sentence) it is said:

    Continue to do this until a number known to be divisible or not by 7 is obtained; you can stop when this number has at most 2 digits...

    Thanks for your help.

  • Custom User Avatar

    @g964: A little bit of both. All the talk about "divisiblity" makes a user think that this will probably be something where one should return true or false and the number of steps needed to get there. Only in the last sentence you actually say that you're interested in m < 100 and the number of steps to get there, which is quite late.

  • Custom User Avatar

    Too long or misleading?

  • Custom User Avatar

    Well, to be honest, the description is rather misleading. It could be shortened to:

    A number m of the form 10x + y is divisible by 7 if and only if x − 2y is divisible by 7. If x - 2y has more than two digits, you can repeat the process until you have only a two digit number.

    Your task is to return an array of numbers, the first being a number with at most two digits obtained by the process described above, the second one being the number of steps to get the result.

  • Custom User Avatar

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

  • Custom User Avatar

    uh ok ok got it,
    I was doing that but now it's working, thanks.

  • Custom User Avatar

    Never modify the input of a function.

    The same list is being used to test the function multiple times.
    Since you modify the list in the first call. Your answer is different for the scond call.

  • Custom User Avatar

    What's going on?
    in the second test I get this..
    "'n' is 2: [3, 4, 5, 1, 2] should equal [4, 5, 1, 2, 3]" what??

    but when I run my code in https://repl.it/languages/python3 I get the right return [4, 5, 1, 2, 3]... is this a bug or something?

  • Custom User Avatar