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.
Fixed in latest fork
Approved
Random tests almost always expect
False
.A function that simply returns
False
will pass after few tries.Sample test is wrong and confusing.
test.expect(True)
does not make sense (always pass)False
followed byexpect(true)
is very confusingnot facors but divisors.
This is a rather simple kata that doesn't take nuances like this into account.
For that, check out the next one:
https://www.codewars.com/kata/decode-the-morse-code-for-real
This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
decode the bits correctly.
Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.
The function name should be in snake_case.
Nice kata, but please fix the exmaple test case as pointed out by @SteffenVogel_79. Also, it would be beneficial for users to show the tests input values instead of having to print them out for debugging.
Additionally please follow python coding standards and change the function name to
saving_Lives
Nice idea for a kata.
Some hints:
The example-tests do not make any sense. Test.except(true) is always succeeded.... Test.except(false) will always fail.
You should test some edge cases. For that it is important, that you allow also == for the time!
Hi,
Typo in the second line of the description (I suppose) : "directory" instead of "dictionary".
About the kata itself, this seems not logical to store ['None'] instead of a simple empty list when the number is prime:
if no factor, len(list) == 0
makes more sens/be better practice thanif no factor, len(list) == 1 and lst[1] == 'None'
. I think you should modified your kata about this point.Regards,
B4B
Thanks for the feedback. I've adjusted the kata description. I appreciate the input!
Thank you for the input. I've gone in and created a set of random test cases. Much appreciated!
Description could be clarified in two ways:
1 Clarification of the purpose of values
n
andm
.2 Be explicit that 1 and the number itself are excluded from the list of factors.
Loading more items...