Tech Study

Write a Python program to access a function inside a function

Introduction

Write a Python program to access a function inside a function. I have used python 3.7 compiler for debugging purpose.

def test(a):
        def add(b):
                nonlocal a
                a += 1
                return a+b
        return add
func= test(10)
print(func(10))

Result

Write a Python program to access a function inside a function
Write a Python program to access a function inside a function

TaggedWrite a Python program to access a function inside a function

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more