def f1():
s = 'Mr.Dr'
def f2():
print(s)
f2()
f1()
function call with in function ...............MrDr
Anonymous Functions in Python
def cube(x): return x*x*x # without lambda
cube_l = lambda x : x*x*x # with lambda
print(cube(7))
print(cube_l(7))
output 343 343
program
def square_value(num):
return num**2
print(square_value(2))
print(square_value(-4))
కామెంట్లు లేవు:
కామెంట్ను పోస్ట్ చేయండి