Negative Indexation | Strings
Data Types in Python

Course Content

Data Types in Python

## Data Types in Python

1. Getting Familiar With Numbers in Python
2. True or False?
3. Strings
4. Bring All the Topics Together

# Negative Indexation

In the preceding chapter, it appeared that we were counting letters to determine the index corresponding to each letter. If we intend to access the final symbol, manual counting may seem cumbersome.

Python, however, is considerate and anticipates our needs. Consequently, it introduced negative indexing. To obtain the last character of a word, it is advisable to utilize the syntax `word[-1]`.

Note

The negative indexation starts from -1, then -2, etc. `word[-0]` is the same as `word[0]` for Python.

A small piece of advice: We can mentally divide a string into two parts and use positive indexation for the left-hand part and negative indexation for the right-hand part, but it's always up to us.😏

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Everything was clear?

Section 3. Chapter 5

# Negative Indexation

In the preceding chapter, it appeared that we were counting letters to determine the index corresponding to each letter. If we intend to access the final symbol, manual counting may seem cumbersome.

Python, however, is considerate and anticipates our needs. Consequently, it introduced negative indexing. To obtain the last character of a word, it is advisable to utilize the syntax `word[-1]`.

Note

The negative indexation starts from -1, then -2, etc. `word[-0]` is the same as `word[0]` for Python.

A small piece of advice: We can mentally divide a string into two parts and use positive indexation for the left-hand part and negative indexation for the right-hand part, but it's always up to us.😏

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Everything was clear?

Section 3. Chapter 5

# Negative Indexation

In the preceding chapter, it appeared that we were counting letters to determine the index corresponding to each letter. If we intend to access the final symbol, manual counting may seem cumbersome.

Python, however, is considerate and anticipates our needs. Consequently, it introduced negative indexing. To obtain the last character of a word, it is advisable to utilize the syntax `word[-1]`.

Note

The negative indexation starts from -1, then -2, etc. `word[-0]` is the same as `word[0]` for Python.

A small piece of advice: We can mentally divide a string into two parts and use positive indexation for the left-hand part and negative indexation for the right-hand part, but it's always up to us.😏

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Achieve the following symbols `a`, `g`, `e` using negative indexation.

Everything was clear?

In the preceding chapter, it appeared that we were counting letters to determine the index corresponding to each letter. If we intend to access the final symbol, manual counting may seem cumbersome.

Python, however, is considerate and anticipates our needs. Consequently, it introduced negative indexing. To obtain the last character of a word, it is advisable to utilize the syntax `word[-1]`.

Note

The negative indexation starts from -1, then -2, etc. `word[-0]` is the same as `word[0]` for Python.

A small piece of advice: We can mentally divide a string into two parts and use positive indexation for the left-hand part and negative indexation for the right-hand part, but it's always up to us.😏

Achieve the following symbols `a`, `g`, `e` using negative indexation.