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.
very witty
by "if index"
Very nicely worded code.
Yup. Forgot that
%
operator formatting detail myself that it accepts tuples.Yeah, the specifications are not clear...
You are correct. I had this nested in a try/except clause beforehand to catch that error. I took it out when I noticed there wasn't any other 0.0 cases. Should probably put it back in :D
I'm not sure why an input preprocessing that loses precision and rounds numbers in not-so-straightforward ways would be added to any kata...
Anyway, what rule would you suggest that would map
0.06
to"0.06"
? This coincides with float-to-int conversion in some languages. If you mean those, you'd need to write a full specification of this conversion in the description and users would need to reimplement that in other languages.What is Decimal('0.06')? I should have said:
0.06 -> "0.06" -> Decimal("0.06")
to be more explicit.From type
float
to typeDecimal
? OK, the exact value offloat(0.06)
isDecimal('0.059999999999999997779553950749686919152736663818359375')
, then what?Transformed from float to decimal.
Transformed from what to what? I got an exact number with 53 significant binary digits. Rounded down, the number was less than decimal
0.06
.This comment is hidden because it contains spoiler information about the solution
This worked, Thanks!
Try again, please. I just removed the 0 case which seems to be problematic.
Floating point numbers follow IEEE specifications in all or almost all languages, so it's the same everywhere.
Loading more items...