In [2]:
fn = lambda x, y, z: (x ** 2) + (y * 2) + z
In [3]:
fn(4, 5, 6)
Out[3]:
In [6]:
format = lambda obj, category: 'The "%s" is a "%s".' % (obj,category,)
In [7]:
format('pine tree', 'conifer')
Out[7]:
In [10]:
si=lambda p,r,t:p*r*t/100
In [11]:
si(4,5,6)
Out[11]:
In [13]:
a = lambda x, y: (x * 3, y * 4, (x, y))
In [14]:
a(3,4)
Out[14]:
In [18]:
rect=lambda l,w:(l*w,2*(l+w))
In [19]:
rect(4,5)
Out[19]:
In [21]:
cir=lambda r:(2*3.14*r,3.14*r*r)
In [22]:
c=cir(4)
print('perimeter is ',c[0],'area of circle is',c[1])
In [25]:
rect=lambda l,w:(l*w,2*(l+w))
r=rect(7,8)
print('Area of Rectangle is',r[0],'Perimeter is ',r[1])
In [ ]: