Example & Tutorial understanding programming in easy ways.

What is the syntax for List Comprehension in Python

Syntax:

list=[var for var in iteration]

Example:

l=[i for i in range(10)]

print(l)

Output:

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


Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!