In this Python tutorial, we will learn: Lists in Python: Indexing. What is indexing?, How to access individual items in a list? Use of Negative index in a list? Indexing error, TypeError error, Examples.
What is an Indexing in list in Python?
Each item in the list can be individually accessed using its index.
An index is an integer.
An index of a list starts from 0. The first item in the list is at index 0, the second item is at index 1, the third item is at index 2, and so on.
How to access individual items in a list in Python?
We can access an item in the list by specifying its index within square brackets.
a=['cat', 'dog', 'horse','cow’]
print(a[0])
Output:
cat
What is negative index in Python?
We can also use negative integers for the index.
The integer value -1 refers to the last index in a list, the value -2 refers to the second-to-last index in a list, and so on.
What is Indexing error in Python?
Python will return an IndexError error message if you use an index that exceeds the index value in your list.
What is type error in indexing in Python?
TypeError error:
Indexes can be only integer values; floats data types will cause a TypeError error.
This video is for CBSE students.
This video is for engineering students.
This video is for anyone (BCA, MCA, BTECH, BSc, MSc, PGDCA, Diploma and computer engineering students, under graduate or post graduate computer science students) who is interested in learning Python programming.
This is the best Python tutorial on YouTube.
Our video series is a Python tutorial for beginners. This video series will guide you through how to learn Python from scratch.
I am Ambika, having 20 years of teaching experience. My mentor, friend, and guide, Situn (Anand), is a genius with an excellent academic records and is currently working on machine learning.
Please like, share and subscribe to our channel.
Thank you.
With love,
SA Educational Hub
Lists in Python introduction:
• Python Lists | Lists in Python exampl...
Link to Data types in Python:
• Data Types in Python | Numeric | Stri...
Literals in Python:
• Literals in Python | String Literals ...
Errors in Python:
• Errors in Python | Syntax Errors | Lo...
Rvalue and Lvalue
• Lvalue and Rvalue | Lvalue and Rvalue...
#pythontutorial
#python
#cbse
#cbseclass11
#cbseclass12
#cbsepython
#pythonprogramming
#learnpython
#pythontutorialforbeginners
#pythonlanguage
Links to other videos:
Channel :
/ @saeducationalhub5697
String Operations:
• String Operations in Python | Concate...
Indexing and Slicing in Python:
• Indexing in Python | Slicing | Forwar...
Pattern Programs:
• Pattern Programs in Python | Python P...
Summation Series:
• Summation series in Python | Python P...
Break and continue:
• Break and Continue in Python | Differ...
For loop
• Python for loop | python range() func...
While loop:
• Python While Loops | while loop in Py...
Flowchart :
• Flowchart | Flowchart symbols with e...
Indentation in Python
• Indentation in Python | Python Indent...
Errors in Python
• Errors in Python | Syntax Errors | Lo...
Accepting input from user
• Accepting input from the console in P...
Type conversion:
• Type conversion in Python | Implicit ...
Data types in Python:
• Data Types in Python | Numeric | Stri...
Operator precedence:
• Operator Precedence in Python | Assoc...
Evaluation of expression:
• Evaluation of Expressions in Python |...
Mutable and immutable:
• Mutable and Immutable in Python | dif...
String data type
• String data type in Python | String i...
List data type in Python:
• List data type in Python | List | Lis...
Tuple data type in Python:
• Tuple data type in Python | Tuple | T...
Dictionary data type:
• Dictionary data type in Python | Dict...
Boolean data type
• Boolean data type in Python | Boolean...
Comments
• Python Comments | Comments in Python ...
Rvalue and Lvalue
• Lvalue and Rvalue | Lvalue and Rvalue...
Python variable
• Python Variables | Variables in Pytho...
Identity operators in Python
• Identity operators in python | is ope...
Operators in python
• Operators in Python | Arithmetic | Co...
Literals in Python:
• Literals in Python | String Literals ...
Introduction To Python:
• Introduction To Python | what is pyth...
Features of Python
• Features of Python | Python Tutorial ...
Install python on Android
• How To Install Python On Android|Pyth...
Compiler Vs Interpreter
• compiler vs interpreter | difference ...
Hello World in python:
• Hello World in python | Interactive m...
Print Vs sys.stdout.write
• print vs sys.stdout.write in python |...
What does print return
• What does print () return in python |...
Character set in Python
• Python Character Set | Python Tokens|...
Identifier
• Identifiers in Python | Python Tutori...
Keywords
• Keywords in Python | Python Tutorial ...
What does print return
• What does print () return in python |...
What is a data type in Python
• What is a data type in Python | Diffe...
islower isupper
• Python islower() | Python isupper() |...
Python Lists : Indexing | What is an Indexing |Negative index in list | Indexing error | TypeError | CBSE | Examples