-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLambda.py
97 lines (57 loc) · 999 Bytes
/
Lambda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#lambda arguments:expression
# x=lambda a:a+2
#y=lambda a:a+3
# print(x(4))
# x=lambda a,b,c:a+b*c*7+4
# print(x(4,6,7))
# def mult(a):
# return lambda n:n+6*a
# x=mult(5)
# print(x(4))
#--------------------------------------
# def square(n):
# return n*n
# print(square(5))
# y=lambda x:x*x
# print(y(5))
# x=lambda a,b:a*b
# print(x(2,8))
#--------------------------------------
# def mult(n):
# return lambda a:a*n
#
# num=mult(6)
# print(num(7))
#
# num1=mult(7)
# print(num1(7))
# def add(a):
# c=a+2
# return c
# print(add(5))
#(same with lambda and function)#
# x=lambda b:b+2
# print(x(5))
# x=lambda a,b:a*b+5
# print(x(7,5))
# def multi(n):
# return lambda a:a*n
# z=multi(6)
# print(z(5))
# y=multi(7)
# print(y(8))
# x=lambda a,b:a*b-2
# print(x(2,3))
# def mult(n):
# return lambda a:a*n
#
# z=mult(6)
# print(z(7))
#
# a=mult(8)
# print(a(9))
z=lambda x,y:x*y
print(z(2,7))
def mark(n):
return n*n
print(mark(2))