Ad
  • Custom User Avatar

    Though I agree that the description could be improved, it is not asking you to write code for the player behavior, just the dealer. In this scenario, the players have already drawn all of their cards, and you simply have to write code for a function that draws cards for the dealer until their total score is 17 or higher, and then returns a list of which players won according to the rules given.

  • Custom User Avatar

    Hey @KiplandDynamite - basically the kata has some input validation tests; at the bottom of the description it's saying "It should throw errors for empty strings or strings which don't represent a decimal number.".

    So it's actually up to you and your code to raise a Python error when the input is "invalid" i.e. when the input string is empty, or does not represent a decimal number (which is the case here).

    If you are new to Python, or haven't encountered this yet in any case, the way this is done is with the raise keyword - you can Google something like "raise exception Python" if you want more details and some examples but basically the syntax is: if (bad condition is True): raise

    The Python official docs aren't super helpful with examples, but this site is quite nice https://realpython.com/python-exceptions/ - disclaimer: I'm not paid by/ or endorsing them ;)

  • Custom User Avatar

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

  • Custom User Avatar

    What language?

  • Custom User Avatar

    The answer to your first post is yes. About your code, you should print stuff to the console and check whether your code is actually doing what you are expecting.

  • Custom User Avatar

    Look hard at your last if condition.

  • Custom User Avatar
  • Custom User Avatar

    I don't know where is the flaw in your code, but you should use System.out.println to try to find where your code is bugging.