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 the question says
Given the triangle of consecutive odd numbers:
and don't suggest on bulding one.would have been better if the format of the question is reformated or give clean picture on how to access the triangle
of numbers
sorry
And why are you posting this without marking it as a spoiler?
This comment is hidden because it contains spoiler information about the solution
Description shows you exactly how the pyramid is constructed. And as it states, N is the row of pyramid that you have to return (as sum of its elements). You can either create the pyramid yourself, or look for some pattern that would help you calculate the sum in more mathematical way. Or simply, skip it for now :P
To give you a start, try to find a formula on how to calculate the sum of every number 0 to n. So for n = 10 it would be (1+2+3+4+5+6+7+8+9+10) = 55. You could calculat this with a for loop or you could come up with a formula.
This comment is hidden because it contains spoiler information about the solution
I solved it by looking at the amount of white cells in each row.
This comment is hidden because it contains spoiler information about the solution
Did you do this:
return print(...)
?print
returnsNone
, return the number instead (removingprint
).How does
None
(which is returned by your function) match expected value of 9414?Please read this paragraph, it contains answer to your problem: https://docs.codewars.com/training/troubleshooting#expected-the-same
Read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same
Your code should handle that last case that raises an error.
Yes.