Python Lists Made Easy π₯ | Creating, Accessing & Updating Lists | Python Lesson 11
About this video
Learn Python Lists β Creating, Accessing and Updating in an easy and practical way with PEARL INSTITUTE BATALA.
In Lesson 11 of our Python + Machine Learning Practical Course, you will learn how Python Lists allow us to store multiple values inside a single variable.
This lesson is specially designed for beginners and explained with simple practical examples in Hindi/Hinglish.
β In this lesson you will learn:
β’ What is a Python List?
β’ How to Create a List
β’ Square Brackets [ ] in Lists
β’ Accessing List Items
β’ List Indexing
β’ Why Indexing Starts from 0
β’ Negative Indexing
β’ Using -1 to Access the Last Item
β’ Updating List Items
β’ Lists are Changeable
β’ Using len() with Lists
β’ Storing Different Data Types in a List
β’ Practical Student Marks Example
β’ IndexError: List Index Out of Range
β’ Common Beginner Mistakes
β’ Quick Practice Question
β’ Use of Lists in Machine Learning
π» Simple Python List Example
courses = ["Python", "Java", "Web"]
Access the first item:
print(courses[0])
Output:
Python
Access the last item using negative indexing:
print(courses[-1])
Output:
Web
Update an item:
courses[1] = "C++"
Now the list becomes:
["Python", "C++", "Web"]
π Important Rule
Python List indexing starts from 0.
For a list containing 3 items, the valid positive indexes are:
0, 1, 2
Trying to access index 3 will cause:
IndexError: list index out of range
π― Perfect For:
Python Beginners
Coding Beginners
School & College Students
BCA Students
B.Sc. IT Students
MCA Students
Computer Course Students
Machine Learning Beginners
Students Learning Programming from Scratch
π€ Machine Learning Connection
Python Lists are useful for temporarily storing values, labels, marks and feature values before working with structures such as NumPy Arrays and Pandas DataFrames.
π Course: Python + Machine Learning Practical Course
π Lesson 11: Python Lists β Creating, Accessing and Updating
π« PEARL INSTITUTE BATALA
π Near Bus Stand, Jalandhar Road, BATALA
π Call / WhatsApp: 7814976999
π www.PEARLINSTITUTE.in
π©βπ« Institute Head: Mrs Sonika Malhotra
π Subscribe and continue learning Python step by step.
π Next Lesson: Python Tuples β Ordered Immutable Data