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.
No need for parentheses as 'and' has priority over 'or'. Readability for humans suffer though :)
You can remove "else" at the end
The same
good.
Im curious as to why we do not need to specify return "false" or "true" in this example?
Math is allowed, what you are getting is:
"Math::DomainError (Numerical argument is out of domain - "sqrt")"
you could use 'raise' to attend it or use logical expression to ensure the positive range of the number before use Math::sqrt
This comment is hidden because it contains spoiler information about the solution
5.0/9.0 can just be 5/9 -- Python 3 automatically converts ints to floats when needed. That's why // (floor divide) is a thing.
Ideally it should be pothole_case(or snakecase as you call it). I guess they are used to typing in other languages more than Python?
But yes, they should not be in CamelCase.
Why are these naming the functions in camelcase (convertToCelsius) instead of snakecase (convert_to_celsius)?
Thanks for mentioning. I am new on this platform and didn't know the purpose of spoiler flag. Now I knnow. Thanks :)
Use spoiler flag, please.
This comment is hidden because it contains spoiler information about the solution
You get this error when you pass a negative value to Math.sqrt. You can't pass negative to it.
i agree, for example 1e16+1 returns true when it shouldn't
Loading more items...