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 |
Explain about lambda in python?
What are python templates?
Explain split(), sub(), subn() methods of “re” module in python.
How to remove values to a python array?
What is instance method?
Is integer immutable in python?
What does file flush mean?
How can we get home directory using '~' in python?
How is python used in business?
What is singleton class in python?
What are the rules for local and global variables in Python?
What is lambda? Why do lambda forms not have statements?