python terminologies
1. lambda
1 min readAug 17, 2020
‘lambda’ is a keyword that lets you create lambda functions. These are anonymous functions used to perform simple computations.
Example,
- >>> x = lambda a, b: a + b
- >>> x(5, 6)
Now, x is a function that takes two arguments and returns their sum.
2. list
A list in Python is an ordered, mutable collection of objects. These objects can be of different types. Below is an example of a valid list in Python:
- list1 = [‘python’, 2, 9.0]
3. List comprehension
List comprehensions provide a way to create lists in a concise manner. We do this by writing an expression inside square brackets and assigning it to a variable.
Example,
- list1 = [i for i in range(10)]
Output:
>>> list1
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
This is python terminologies