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.
then what must be used ?
This comment is hidden because it contains spoiler information about the solution
Not a kata issue, your function is returning
None
or not returning and that's the default return value for Python. You can see in the kata description thatFalse
is the expected value for those input values.I got everything right except for the last sample test is_opposite("" , "") keeps giving a NONE SHOULD BE FALSE.
I faced the same issue why is there a not.
Do you see the single quotes there? You're returning strings instead of numbers.
I changed what you suggested and I still cant get the tests to go through, look at the test results:
Test Results:
Fixed tests
Tests
should return 1 litre: '1' should equal 1
Test Passed
should return 6 litres: '6' should equal 6
Test Passed
should return 5 litres: '5' should equal 5
should return 893 litres: '893' should equal 893
Test Passed
inexplicable lol.
Your function is printing the result instead of returning it, and also, you don't need to add that string to it, only return the number.
using round() function in python doesnt help
Read the error message:
You can't convert a letter to an int, that's what it is about.
n is an integer I did convert it into an integer. I cant seem to find my problem.
Here is my code:
def f(n):
return sum(range(0,int(n)+1))
You code only passes 4 tests (there are more), not a kata issue.
Try this one in sample tests:
6 maybe in the string format
This comment is hidden because it contains spoiler information about the solution