At the appropriate places in my code, I am checking for a valid guess from the user. If the guess is invalid, I am issuing the following (based on what I read in the instructions for the kata):
raise ValueError("A number should be positive and contain 4 distinct digits.\nThis turn is not counted")
I have debugged the execution of my solution and confirmed that it is reaching this point in the code when it should (i.e., on invalid input). But somehow my solution is failing with the message that I did not raise a ValueError. I've read all the documentation that I can find about raising exceptions in Python 3, but I can't figure out why the line above isn't working. Can someone point me in the right direction?
That's just what I was thinking!
Would be more challenging if you used no imports isn't it?
And then on production suddenly there are 393 goals in a match for some reason..
In case anyone's curious, you need to validate the secret number upon initialization and the guess when calling the compare method.
That was good fun, thank you!
A minor typo in the description:
... returns a String format[T]ed as "X bull/bulls ...
At the appropriate places in my code, I am checking for a valid guess from the user. If the guess is invalid, I am issuing the following (based on what I read in the instructions for the kata):
raise ValueError("A number should be positive and contain 4 distinct digits.\nThis turn is not counted")
I have debugged the execution of my solution and confirmed that it is reaching this point in the code when it should (i.e., on invalid input). But somehow my solution is failing with the message that I did not raise a ValueError. I've read all the documentation that I can find about raising exceptions in Python 3, but I can't figure out why the line above isn't working. Can someone point me in the right direction?
task however is to print "Hello World!", about new line nothing is mentioned?!
actually you can learn how to print the new line character if you want to use print
Thank you!
Done.
Hmm weird, but I will know better next time
one cannot see the solutions, but the comments are visible/accesible from the dashboard
Um, wait I thought you couldn't see solutions if you didn't solve the task first...
Added a fixed test, now this solution is invalid.
Loading more items...