Shubham Saboo
Shubham Saboo

@Saboo_Shubham_

4 Tweets Jan 11, 2023
How do list comprehensions simplify your Python code and make it more readable?
Let's assume you have a list of numbers, and you want to square each number.
There are two ways to do that 👇
1. Using for loop
- Conventional and time consuming
- More lines of code
- Not so readable
2. List Comprehension
- Less lines of code
- Easily readable
If you enjoyed this thread:
1. Follow me @Saboo_Shubham_ for more Python content
2. Like and RT the tweet below to share it with your audience

Loading suggestions...