Over a million developers have joined DZone.

Python List: A Complete Tutorial [Video]

DZone's Guide to

Python List: A Complete Tutorial [Video]

A developer gives a great video tutorial on how to work with data structures, specifically lists, when working with Python.

· Big Data Zone ·
Free Resource

Hortonworks Sandbox for HDP and HDF is your chance to get started on learning, developing, testing and trying out new features. Each download comes preconfigured with interactive tutorials, sample data and developments from the Apache community.

This video tutorial is on Python lists and how to work with them.

Video Content:

0:12-Introduction to list. 1:48-Different methods to create lists.

1:50-Empty List.

2:00-List of strings.

2:10-List of numbers.

2:18-List of numbers using list comprehension (using for loop).

2:44-List of numbers using range.

2:55-Creating a list of even numbers less than 10 using list comprehension.

3:18-Creating a list of even numbers less than 10 using range.

3:36-Creating List from comma separated strings.

4:04-Put all characters in a string to list.

4:30-Put each digit in an integer to list.

4:53-Convert the dictionary key or value to list.

5:49-Built-in functions for lists in python.

5:57-list.append() to append a single element at the end of the list.

7:00-list.extend() to append each element of one list to another list.

7:40-list.insert() used to insert an item at a particular location.

8:25-list.index to fetch the index of an item in the list.

9:08-list.remove method to remove an element from the list.

9:35-list.pop method which removes and returns us the element from the list.

10:23-list.sort to sort the list either in ascending or descending order.

11:00-list.reverse method is used to reverse the list items.

11:27-len method to get the length or number of items in a list.

11:53-min and max functions to find the minimum or maximum value in a list.

12:26-list.count method to find how many time an item appears in the list.

12:58-list.clear method to remove all the elements in the list.

13:20-To check if an item exists in the list.

13:52-indexing the Python list.

14:00-fetch the first element.

14:27-get the last item.

15:04-Slicing (fetching specific portion of our list) examples.

15:56-slicing with increment or skipping.

16:45-Slicing in reverse order.

17:25-reversed function to iterate a list in reverse order.

18:28-Slice Assignment to insert or replace items of one list inside another list at a particular location. 19:25-remove elements using slicing assignment.

19:41-how to copy list, understand why copying a list is tricky.

22:40-copy list using deep copy.

23:16-for loops on lists.

24:05-join all the contents in the list in to a string.

24:55-convert a list of lists in to a flat list.

25:46-see if list has duplicate elements.

26:40-shift or rotate the list

Hortonworks Community Connection (HCC) is an online collaboration destination for developers, DevOps, customers and partners to get answers to questions, collaborate on technical articles and share code examples from GitHub.  Join the discussion.

python ,big data ,data structures ,python lists ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}