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.
You can also start enumerating from any int you want
in this case it would be
enumerate(str(n),p)
I recommend always to check the documentation whenever you see something new
Seeing other solutions is always nice to learn some new functions, Nice!
you are right, i will start at 0 on the first loop so what ever is passed in is the first exponent. on the second loop it will be incremented and so on. Good solution. I learned something new here!
It only works if both are there, since it's a ternary condition and not "normal" if-else statements.
@Lurvetti i did a golfed version of this, just for fun
@Steffan153 can you beat it? ;)
Yes.
'b' * True
is'b'
because the integer ofTrue
is 1.And
not 0
isTrue
because the boolean of0
is False, and revert that is True.