Skip to content

Commit fc4e1bc

Browse files
committed
using lambda function
1 parent ddda562 commit fc4e1bc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

function_programming.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
def reverse_len(s):
44
return -len(s)
55
y=sorted(animals, key=reverse_len)
6-
print(y)
7-
6+
87
# lambda function = <para_list>:<expression>
98

109
result=(lambda a,b,c: (a+b+c)/4)(10,40,5)
1110
print("lamda function: " + str(result))
11+
12+
std=sorted(animals, key=lambda s: -len(s))
13+
using_sort = animals.sort()
14+
15+
print(using_sort)

0 commit comments

Comments
 (0)