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.
Python 2 will perform floating point division if either the divisor or divident is floating point. Constants are floating point if you include a decimal point. 4 is an int. 4.0 a float. Or you could cast an int variable to float with a float().
I've just refreshed the kata so all Python language version should be enabled ;-)
This comment is hidden because it contains spoiler information about the solution
CW uses 3.4.3 (3.6 hasn't been working for quite a long time already) so that might explain the differences.
yep I tested it and Voile is right, the empty test is the issue.
Interestingly enough when I tested this code myself it works in Idle but I'm using 3.6 and codewars isn't. So either testing none is causing errors due to python versioning issues or (more likely) its an issue with how I've written the test cases.
Anyway, the following None test DOES WORK:
I think it comes from your line after
>>> head_of_list([])
, which has a completely wrong indentation.Also, that's not the way for checking if the result is
None
.This comment is hidden because it contains spoiler information about the solution
This doctest fails the test. For some reasons the test expects
nothing
whenNone
is returned.could you show the code? If I can recreate the issue myself, I might be able to figure it out. :)
How to fix that? Getting EOF syntax error.
https://www.screencast.com/t/NGzAvV03F9
This comment is hidden because it contains spoiler information about the solution
Why in Python it doesn't work with 'is' statement but works writh '==' statement?
This comment is hidden because it contains spoiler information about the solution