Why is there a "return" at the end of the "if" statements?

I’m currently doing the python intro class, and I’m in the “Hash Maps” module. While going through the lesson, I came across “returns” at the end of “if” statements (at the bottom of the picture), but I’m having trouble understanding what exactly is being returned (as there is no additional code after the “returns”). Any help would be greatly appreciated!

Looks like the function’s job is done. return is a way to ensure the function is exited.


What’s there to note is that the action is setting the value of an instance variable. Once done there is nothing else to do and no variable waiting at the caller to receive a return value. The return value in this case is, None.