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.
1.) You need to return your output instead of printing to the console.
2.) You need to change
2n+1
to2*n+1
.3.) You need to sort out your logic. You put
n=0
and then do2n+1
resulting in only two pathways - 0 or 1. This means a length of greater than 1 will not branch to the if statement, meaning None will be returned.4.) While loop is unecessary. Validation of input is okay, but change it from a while loop to an if statement. Also, change it from
type == int
totype == str
.This comment is hidden because it contains spoiler information about the solution