FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
60-python-projects/function_programming.py at main · Dihfahsih1/60-python-projects · GitHub
Dihfahsih1
/
60-python-projects
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
60-python-projects
/
function_programming.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
15 lines (10 loc) · 342 Bytes
Breadcrumbs
60-python-projects
/
function_programming.py
Copy path
File metadata and controls
executable file
·
15 lines (10 loc) · 342 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
animals
=
[
'dog'
,
'zebra'
,
'elephant'
,
'lion'
,]
def
reverse_len
(
s
):
return
-
len
(
s
)
y
=
sorted
(
animals
,
key
=
reverse_len
)
# lambda function = <para_list>:<expression>
result
=
(
lambda
a
,
b
,
c
: (
a
+
b
+
c
)
/
4
)(
10
,
40
,
5
)
print
(
"lamda function: "
+
str
(
result
))
std
=
sorted
(
animals
,
key
=
lambda
s
:
-
len
(
s
))
using_sort
=
animals
.
sort
()
print
(
using_sort
)
Back
|
FazBrowse Home
|
New Git URL