I didn't understand what is .append, and lambda | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

I didn't understand what is .append, and lambda

13th Sep 2020, 2:09 PM
HELL_GAMER
HELL_GAMER - avatar
4 Respuestas
+ 6
.append is used to add items to the end of a list. Lambda is known as a anonymous function which is used to create small functions without using def etc... Lambda doesn't has a name so it is called as a anonymous function
13th Sep 2020, 2:18 PM
OfcourseitsRohit
OfcourseitsRohit - avatar
+ 5
Go through the lessons again you will understand
13th Sep 2020, 2:18 PM
OfcourseitsRohit
OfcourseitsRohit - avatar
+ 1
Use append method to add new element at the end of list lst = [2,3,4] lst.append(5) lambda or anonymous function is another way to create function fastly with short syntax and return value after the colon.before colon you set condition or parameters lambda x:x*2
13th Sep 2020, 2:23 PM
HBhZ_C
HBhZ_C - avatar
0
.append() is a method that adds a SINGLE element to the END of a list. Ex: List = ['a', 1, 'b', 2, 'c', 3, 'd'] List.append(4) print(List) >>> ['a', 1, 'b', 2, 'c', 3, 'd', 4] https://www.programiz.com/JUMP_LINK__&&__python__&&__JUMP_LINK-programming/methods/list/append https://www.w3schools.com/python/ref_list_append.asp https://realpython.com/python-string-split-concatenate-join/ lambda is an anonymous function, this means a function that does not need to be defined, give it a name. square = (lambda x, n : x**n) (2, 8) print(bin(square)) >>> 0b100000000 https://realpython.com/python-lambda/ https://www.geeksforgeeks.org/python-lambda-anonymous-functions-filter-map-reduce/
13th Sep 2020, 2:32 PM
Феникс
Феникс - avatar