50 likes | 82 Views
This presentation on List Comprehension in Python will give you an idea about what is list comprehension and how to use it. You will learn the advantages of list comprehension in this python tutorial for beginners video. You'll understand the different ways to use the list comprehension techniques and solve problems.<br><br>Below topics are covered in this presentation:<br>1. What is List Comprehension in Python?<br>2. Advantages of using List Comprehension<br>3. List Comprehension Demo
E N D
List Comprehension in python • A function is a bunch of related statements that are defined to perform a specific task List comprehension allows you to create a new list with compact syntax and is based on the values of an existing list It is defined inside square brackets and executes each element along with the for loop to iterate over each element Syntax: newList = [ expression(element) for element in oldList if condition ]
Advantages of using List Comprehension • A function is a bunch of related statements that are defined to perform a specific task Accomplish work in fewer lines of code More time efficient Iterative statement appear as formula
Join us to learn more! UNITED STATES Simplilearn Solutions Pvt. Limited 201 Spear Street, Suite 1100 San Francisco, CA 94105 Phone: (415) 741-3319 INDIA Simplilearn Solutions Pvt. Limited #53/1C, 24th Main, 2nd Sector HSR Layout, Bangalore 560102 Phone: +91 8069999471 UNITED STATES Simplilearn Solutions Pvt. Limited 801 Corporate Center Drive, Suite 138 Raleigh, NC 27607 Phone: (919) 205-5565