Python Comprehensions
Hi All,
We all agree that we always choose fast and efficient methodologies in everything. Python also provides us the amazing ,exciting, fast and efficient methodologies for efficient people. One of the efficient way which python yields to developer is Comprehensions.
I assure you will be more addicted to python once you start works on comprehensions. Yeah ! I am addicted to comprehensions now. I would like to share few simple and twisty python comprehensions here.
How normal loop structure looks like,
We can change the loop structure into simple one, may be one line structure as comprehensions.
Exciting ? Lot more we have, we can also include condition in comprehensions.
Looking for dictionary comprehension ? Let’s see that too..
We missed one thing, right ? Yeah ! Complex problem needs complex loops.
Any dimensional loops can be comprehensive in Python. Don’t want to try ?
Hope this will make you curious on Comprehensions in Python.
Code and Enjoy !!!