Ad
  • Default User Avatar

    Agreed created the solution and then came across that the test cases aren't even working

  • Default User Avatar

    That shouldn't be the case since there's no break statement in the for loop. I tried my code with the 3rd test case and it passes the test.

  • Custom User Avatar

    cuz "C" appears twice (once in camel, and another in case) so ur code substitutes it twice (replace will replace all occurrences, read https://www.w3schools.com/python/ref_string_replace.asp . hope this helps !

  • Default User Avatar

    The test is failing on the 3rd test case

  • Default User Avatar

    I just solved this kata in Python to see what's going on - I wrote everything myself, no imports, and it works fine.

    However there are 1-2 tests which are a bit "unexpected" for a 7 kyu: it's not mentioned in the Description, but you need to handle cases where input is not a string.

    To troubleshoot and understand what I'm saying here, you can print the input that the tests are using: to do this, type:

    def check_coupon(entered_code, correct_code, current_date, expiration_date):
      print(entered_code, correct_code)
      print(current_date, expiration_date)
      # rest of your code here bla bla
    

    then in console you'll be able to see which inputs you are failing on.

  • Custom User Avatar

    No example, no proof... Are you aware this is a pointless message?

  • Default User Avatar

    I got the same test failing on python where every other test was passing. Must be a incorrectly written test case.

  • Default User Avatar

    The test cases aren't working properly on this kata for python