https://tutorial.eyehunts.com/python/python-nested-function/
Python nested function