HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

#5 Python Tutorial for Beginners | List in Python

3,529,347 views November 2, 2018 10:42

Watch on YouTube
ChannelTelusko

In brief

This tutorial shows how to create and manipulate lists in Python, covering basics like storing mixed data types, accessing elements by index, and using built-in methods. It’s ideal for beginners who want to handle collections of items efficiently.

Key steps

  1. Create a list using square brackets [] with values of any data type.
  2. Use slicing to extract sub-lists or fetch values by range.
  3. Add items with append() or insert(), remove with remove() or pop().
  4. Clear the list with clear(), delete sub-lists with del, or extend with extend().
  5. Sort the list with sort() or find min/max values using min()/max().

Questions & answers

Can a list contain different data types?

Yes, a single list can store integers, floats, strings, or even other lists.

Description from the creator

Check out our courses:

Agentic AI with Java : Live Cohort : go.telusko.com/agentic-ai-with-java-cohort
Coupon: TELUSKO10 (10% Discount)

Master Java Spring Development : go.telusko.com/learn-master
Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : telusko.com/

Udemy Courses:

Java Spring:- go.telusko.com/Udemyjavaspring
Java:- go.telusko.com/udemyteluskojava
Spring: go.telusko.com/udemyteluskospring
Java For Programmers:- go.telusko.com/javaProgrammers
Python : go.telusko.com/udemyteluskopython
Git : go.telusko.com/udemyteluskogit
Docker : go.telusko.com/udemyteluskodocker

Instagram : instagram.com/navinreddyofficial/
Linkedin : in.linkedin.com/in/navinreddy20
WhatsApp : go.telusko.com/whatsapp
Discord : discord.gg/D8hWe9BqfF


In this lecture we will learn:
- What is a list in Python?
- Lists are mutable
- Creation of a list in Python
- Methods available with the list
- Functions performed with a list

#1
Lists are used to store multiple items in a single variable.
- We have to use a square bracket [], and in that square bracket, we can store multiple values.
- We can print the list through the variable name.
- Lists are Mutable which means values can be changed in the list.
- We can also get the single value from the list using the index value.
- The index value is 1 less than the size of a list as the index value starts from 0.
e.g., If the size of the list is 5, then its index value lies in the range of 0 to 4.
- We can fetch only those values from a list that are in the range of index values of it.
- We can also get a sub-list of a list by using the slicing in a list.
- We can also fetch the value from a list through negative numbers similar to strings.
- A list of strings can also be created.
- We can also create a list that can store values of different data types.
Like it can store integer value, float value, string value etc, in a single list.
- A list of lists can also be created which means a list can also store different lists in it as well.

#2
- Several operations can also be performed using it and it has many in-built functions and methods to use.
- nums. shows all the functions that are available with the list.
- Ctrl + Space can also be used to show the methods.
- append method is used to add a new value to the end of a list.
- clear will clear the entire list.
- insert method can add a value in between the list at the specified index.
- A particular element can also be deleted through the remove method.
- pop method will also remove the element through the index value and return that deleted element as well.
- If you don't specify the index value in the pop method, it will delete and return the last element from the list.
- del is a command through which you can delete a sub-list or multiple values from a list.
del list name[start:end]
- extend method is used to add multiple values or a sub-list in a list.
- sort method is used to get listed in the sorted order.
nums.sort()

#3
- min() function is used to get the minimum value present in a list.
- max() function is used to get the maximum value of a list.
- sum() function returns the sum of all of the values present inside the list.

Github :- github.com/navinreddy20/Python-

More Learning :

Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6

JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq

Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA

Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB

NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L

Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
telusko.com

About this tutorial

Telusko published this 10:42 video tutorial on November 2, 2018. It has been watched 3,529,347 times on YouTube.

Channel
Telusko
Duration
10:42
Published
November 2, 2018
Views
3,529,347
Likes
64,878

Share

This tutorial in other languages