Ad
  • Custom User Avatar

    I solved the problem but then found a set of numbers that should have caused my code to fail.

    I think you need to add a check that has the first part of the answer be = m.

    For example:
    gap(2,100,110)
    Would output [103, 105]

    But:
    gap(2,103,110)
    Would output [107,109] due to my code skipping the first number. My code was able to pass all other test cases.

  • Custom User Avatar

    When you call a list it does not have to call individual values. You can call lists or tuples for example. When you do call a tuple within a list you could use times[0] to represent the english value and times [1] to represent the value. Instead python lets you create a shortcut when creating a for loop. When using this nomenclature it automatically sets times[0] to name and times[1] to secs.
    So for this problem the for loop will go through 5 iterations. The first time the for loop will set name = 'year' and secs = 365 * 24 * 60 * 60.
    Hope this helps.

  • Custom User Avatar

    I'm punching over my head taking on this Kyu, at least for coding, so I wasn't able to reduce my answer very well. I love the way you wrote this answer. It's clear, quick, and easy for me to see how it relates to the math function in my head.