/\(( ⭐⭐w⭐⭐)/\ /\(⭐w⭐ ))/\
It does not say "print a line".
We ride around in the dark, strike on some bulls and cows, then we steal them.
Brilliant! I always overlook reduction, but here it is exactly the needed strategy.
Could you please explain why is this best practices?
Copared with a solution that involves build in methods such as filter and reduce?
I like it, thanks!
I had the same problem, until I understood you also need to validate the game's initialization number and raise an error. Anyway, I've found the description unclear about how to handle the different return cases.
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 ...
... 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?!