python terminologies

1. lambda

Backtworace
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,

  1. >>> x = lambda a, b: a + b
  2. >>> 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:

  1. 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,

  1. list1 = [i for i in range(10)]

Output:

>>> list1
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

This is python terminologies

--

--

Backtworace
Backtworace

Written by Backtworace

I am founder of <a href=”https://pythonslearning.com”>pythonslearning</a>

No responses yet