diff --git a/Closures.py b/Closures.py new file mode 100644 index 0000000..c652faa --- /dev/null +++ b/Closures.py @@ -0,0 +1,12 @@ +def print_msg(msg): + # This is the outer enclosing function + + def printer(): + # This is the nested function + print(msg) + + printer() + +# We execute the function +# Output: Hello +print_msg("Hello") \ No newline at end of file