This video gives a detaild explanation of a nested function in python, also it will give an overview of the scope of nested function.
Link for pyspark with hadoop playlist:
• Pyspark with hadoop full course
Link for python full course in shorts playlist:
• Python full course for beginners