Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It's just short, nothing more.
I really liked this kata but i think that could have better instructions. For example, it was a little bit cofusing about the tie match, i tried to understand how would be like if only a team catch the snitch, even if the score be the same, the match will only finish if you catch the snitch. That's just my opinion...
Approved
python new test framework is required. updated in this fork
lol smart but should not be allowed
Fixed.
Okay to be honest, I didn't fully understand the google explanation of mutation. Thanks for the clarification. I solved it without now.
correct! ;)
I based my assumption in the expected results message ;)
...or using
pop
,append
,extend
(the last two are not probable usages here, but...) on one of the lists (which should actually be tuples... EDIT: that's the perfect indication: if one single thing you do with the input couldn't be done with tuples, you're mutating the inputs)If you mutate the input those cases change from those values to these (an additional of 150 points added to whoever catched the snitch):
Mutating the input (in this case) means you're doing
gryffindor[0] = ...
andslytherin[0] = ...
in your code (or+=
).Because the control function uses the mutated values as input. I've solved it without mutating the input and the tests passed. Could you try doing that? Or just wait for the issue to be resolved.
I take the list-elements as they are, no casting or anything.
but still, as I add the numbers as a person would do (not a computer) the answer is still wrong (Gryffindor wouldn't win when it's 100 points behind)
Translation to fix, please (see issue above)
2 posts below, someone reported an issue about input mutation in Python, are you doing that?
I believe in python that your random tests don't always work. I copied some of my output:
Testing for [50, 'yes'] and [300, 'no'] -> after the end of the game it's 200 vs 300
It should work for random inputs too: 'Slytherin wins!' should equal 'Gryffindor wins!'
Testing for [200, 'no'] and [50, 'yes'] -> here it's 200 vs 200
It should work for random inputs too: "It's a draw!" should equal 'Slytherin wins!'
Testing for [300, 'no'] and [50, 'yes'] -> and here 300 vs 200
It should work for random inputs too: 'Gryffindor wins!' should equal 'Slytherin wins!'
Loading more items...