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.
But you can still get float to int variances that the kata cannot account for..
What the hell. This doesn't work! You get float values instead of integer values.
How do you vote down solutions. This is broken and doesn't overcome the float to integer problem that python has and the solution has....
I tried using floor division, but it always returned a float for me. The decimal was 0, so it was indeed an integer divide, but the output always came with a decimal place. Am I missing something here?
This comment is hidden because it contains spoiler information about the solution
For Python 3, simply use integer divide for every divsion instead (change
/
to//
). This eliminates having to explicitly cast the results to int.Indeed doesn't work :p
why don't you try it out for yourself?
;)
This wouldn't work in python3 since range doesn't return a list, right?
Yep.
But this solution solution was written in Python2 where using
/
between two integers meant integer division.Thanks! I wish we can vote for forks, there are many ones better than the original solution.
Very clean and beautiful. This should be the highest voted solution!
newbie here. It seems something wrong with your solution. I think the variance res should be transformed into int type(Python 3.6.0)
Wow, how did you think of a solution like this? This is great.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...