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.
Thank you!
In Python:
A list uses square brackets
[1, 2, 3]
When you use parentheses, that's a tuple
(1, 2, 3)
You can read more here
You don't need the parentheses around petals in the return line.
This comment is hidden because it contains spoiler information about the solution
Fixed.
Fixed.
Done.
Fixed that and Sample tests didn't work either, fixed that too.
That code isn't ok, the error message is explicit about what's wrong there, this is the original code:
where
nb_petals
is a number, I don't know why you use()
in tears there, if you want to declare a list, use[]
If you want to use
%
both operands must be numbers. I can only guess that petals is a list there (given the error message).This comment is hidden because it contains spoiler information about the solution
Isn't petals a list there? You can't use modulo operator between a list and an int. You also missed a
)
there.Confused. I have written two versions of code but while testing I got the error "unsupported operand type for list and int".
Then I just tried to copy similar solution from solutions page, using:
return tears[(petals % len(tears) -1]
and I get the same error.
What can be the reason?
Thank you.
Thanks for this nice kata. I like it a lot ))
Before new 2000 year there were plenty of hot discussions regarding the century 20 or 21... I was also wrong ) thinking that .000year is opening new century )