What is list comprehension? Give an example.
Answer / nashiinformaticssolutions
A syntax component called list comprehension makes it easier to create a list using an existing iterable.
For instance:
[i for i in range(1, 10)] = my_list
| Is This Answer Correct ? | 0 Yes | 0 No |
What is self and init in python?
What is a pil in python?
Why python is a dynamic language?
Which is better list or dictionary in python?
What are the two types of functions in python?
What language is python based on?
Do you always need a default constructor?
What is the syntax for exponentiation and give example?
What data types does python support?
What do you understand by membership operators in python?
Why is python called python?
How to check the string consists of alphanumeric characters ?