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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
def add_binary(a,b):
#your code here
sum = a + b
answer = ""
while sum != 0:
part = str(sum%2)
answer += part
sum = int(sum/2)
return answer[::-1]
My code is able to solve all the fixed cases and half of the random cases. What is wrong with the code. Can anyone help Thanks
I tried my code in an editor, and it works just fine, but when I try it here it comes back with:
Fixture.cs(38,29): error CS0103: The name 'Kata' does not exist in the current context
Fixture.cs(44,33): error CS0103: The name 'Kata' does not exist in the current context
Fixture.cs(50,34): error CS0103: The name 'Kata' does not exist in the current context
Fixture.cs(30,49): error CS0103: The name 'Kata' does not exist in the current context
I don't have 'Kata' anywhere in my code...
Any suggestions?
what will be the test case which will return None as a result.
I have tried with various options.. and it wroked.. and when i am running the sample test cases.. its failing.
Also tried using None keyword.. but it fails as other than integer (be it + or -) is not allowed (NoneType not defined).
Please share one case which expects the result as None.
The description should specify that the numbers are non-negative integers. The solution to handle floating point and signed integer numbers is more complex, and not covered in the test cases.
Test case for negative numbers should be included