Hello, @ulwianamehta-malhotr. Welcome to the forum.
return
stops the execution of your function, and returns the value included in the return
statement (if one exists) to the caller (the line of code that called the function). If you want your for
loop to make more than one iteration, you can’t can’t return
anything until it is finished. See this post for an additional explanation: FAQ: Code Challenge: Loops - Reversed List
Happy coding!
Also, please use the </>
button in the menu bar above where you type to format your code. This is especially important with Python where indentation is not optional. Click the </>
button first on a blank line, and then paste your code in the space indicated.
Thanks!