From the course: Get Ready for Your Coding Interview

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Review of list (array) in Python

Review of list (array) in Python

- In this video, I'm going to give you a quick review of Python Lists. You may be already familiar with the concept of Array, in other languages, such as Java, but in Python, the equivalent type that's most commonly used, is called List. Just like an Array, a List is basically a collection of elements. Whatever their types might be. They could be numbers, strings, or we could even have a List of Lists in Python. An Array, or Python List, is one of the most commonly used types. So it's important to know, how to use it for coding interviews. Now to initialize a List, you can write, "a = [ "item 1", "item 2", "item 3"], and this initializes a List named "a", with the three strengths. To retrieve an element from this List. You can write "a [0]", which retrieves the first element, item one, and "a [1]" retrieves the second element, item two. So Python lists is zero indexed, or the indexes in a Python List start…

Contents