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.
still what he did requries more brain
well at least this guy wasn't lazy... but builtin functions can do miracles
This is a solution that needs to be studied.
Thats the problem when you skip built in functions video
🤣🤣🤣
Erm, no? The only reasonable approach is to use the features provided by the language. Unless, of course, you're specifically asked to do the conversion manually, but even in that case, this is an unclear, convoluted, and inefficient solution.
If you're in a viewer and the interviewer asks you to write a program that prints the result of an addition in binary, this is the code that they want to see you write, not the python one that uses a ready made function
For me, this solutin means that the coder realy understands the rationale of binay, although probably it isn't the best way to do binary.
why whold you do that?
take it ez man 😂😂
If sum=12 in add_binary method, then place_holder in the while loop first takes the value of 3 and then it takes the value of 2. Hence number = 0 + 10^3 + 10^2 = 1100 and sum = 12 - 2^3 - 2^2 = 0 thus exiting the loop. Run over your logic again.
That's not right. Suppose the input is 12, the out put is 1011.2, the correct answer is 1100.
nah mate , too much code for builtin function
:|
It's just a different way of solving the problem. I believe that a good balance between being aware of the correct syntax and being able to re-derive basic functions is essential for any good coder.
i worry about having to pull something like this off during an interview just for not knowing how to format a number to binary -.-