filmov
tv
Indexing in Python | Slicing | Forward and Backward (Negative) indexing | Indexing Error | CBSE

Показать описание
In this Python tutorial, we will learn: What is an Indexing in Python? How can we access specific character in a string? Forward indexing with examples, Backward indexing or Negative indexes with examples, What is slicing in Python? Examples of slicing, Indexing error with example, Type error with example.
We explained how concept of Indexing and Slicing with examples.
What is indexing in Python?
In Python, a string is a sequence of characters and stored in contiguous memory location.
Each character can be individually accessed using its index.
An index is an integer.
An index of a string stars from 0. Therefore, in the string of N characters, the last character has
an index of N-1.
Python test us two-way index value for each location.
1.Forward indexing
2. Backward Indexing or Negative indexes
Forward indexing:
The index of the first character of the string is 0.
The index of the second character of the string is 1.
Backward indexing or Negative indexes:
Indexes can also have negative values.
The index of the last character of the string is - 1.
The index of the second character of the string is -2.
Slicing:
While indexing can be used to get individual characters from a string, slicing can be used to get a substring (range of characters).
Slicing can be done by specifying the start index and the end index , separated by a colon.
Indexing Error:
Python will give you an IndexError error message if you use an index that needs the index value in your string.
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.
And with Ambika, having 20 years of teaching experience. My mentor, friend, and guide, Situn (Anand), is a genius with an excellent academic record and is constantly working on machine learning.
Please like, share and subscribe to our channel.
Thank you.
With love,
SA Educational Hub
Link to Data types in Python:
Literals in Python:
Errors in Python:
Rvalue and Lvalue
Links to other videos:
Channel :
Pattern Programs:
Summation Series:
Break and continue:
Flowchart :
Indentation in Python
Errors in Python
Accepting input from user
Type conversation:
Date types in Python:
Precedence operator:
Evaluation of expression:
Mutable and immutable:
String data type
List data type in Python:
Tuple data type in Python:
Dictionary data type:
Boolean data type
Comments
Rvalue and Lvalue
Variable python
Identity operators in Python
Operators in python
Literals in Python:
Introduction To Python:
Features of Python
Install python on Android
Vs Interpreter
Hello World in python:
What does print return
Character set in Python
Identifier
Keywords
What does print return
What is a data type in Python
#pythontutorial
#python
#cbse
#cbseclass11
#cbseclass12
#cbsepython
#pythonprogramming
#learnpython
#pythontutorialforbeginners
#pythonlanguage
We explained how concept of Indexing and Slicing with examples.
What is indexing in Python?
In Python, a string is a sequence of characters and stored in contiguous memory location.
Each character can be individually accessed using its index.
An index is an integer.
An index of a string stars from 0. Therefore, in the string of N characters, the last character has
an index of N-1.
Python test us two-way index value for each location.
1.Forward indexing
2. Backward Indexing or Negative indexes
Forward indexing:
The index of the first character of the string is 0.
The index of the second character of the string is 1.
Backward indexing or Negative indexes:
Indexes can also have negative values.
The index of the last character of the string is - 1.
The index of the second character of the string is -2.
Slicing:
While indexing can be used to get individual characters from a string, slicing can be used to get a substring (range of characters).
Slicing can be done by specifying the start index and the end index , separated by a colon.
Indexing Error:
Python will give you an IndexError error message if you use an index that needs the index value in your string.
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.
And with Ambika, having 20 years of teaching experience. My mentor, friend, and guide, Situn (Anand), is a genius with an excellent academic record and is constantly working on machine learning.
Please like, share and subscribe to our channel.
Thank you.
With love,
SA Educational Hub
Link to Data types in Python:
Literals in Python:
Errors in Python:
Rvalue and Lvalue
Links to other videos:
Channel :
Pattern Programs:
Summation Series:
Break and continue:
Flowchart :
Indentation in Python
Errors in Python
Accepting input from user
Type conversation:
Date types in Python:
Precedence operator:
Evaluation of expression:
Mutable and immutable:
String data type
List data type in Python:
Tuple data type in Python:
Dictionary data type:
Boolean data type
Comments
Rvalue and Lvalue
Variable python
Identity operators in Python
Operators in python
Literals in Python:
Introduction To Python:
Features of Python
Install python on Android
Vs Interpreter
Hello World in python:
What does print return
Character set in Python
Identifier
Keywords
What does print return
What is a data type in Python
#pythontutorial
#python
#cbse
#cbseclass11
#cbseclass12
#cbsepython
#pythonprogramming
#learnpython
#pythontutorialforbeginners
#pythonlanguage