Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyLamb
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#Python 2.7.17 #PyLamb: Python Lambda Expression #this code is created by Rezaul Hoque on December 04,2021;contact: jewelmrh@yahoo.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; a=[1,2,3,4,5,10,20,30,40] singleDigit = filter(lambda x:x<10,a) print(list(singleDigit)) total = reduce(lambda x,y:x+y,a) print(total)
[
+
]
Show input
Absolute running time: 0.17 sec, cpu time: 0.03 sec, memory peak: 7 Mb, absolute service time: 0,24 sec
edit mode
|
history
|
discussion
[1, 2, 3, 4, 5] 115