How to Access Character?

In the Python, individual character from a string can be accessed with indexing method.

Untitled

The indexation enables to reference negative address to access the character from back of String, mis.-1 refers to last character, -3 refers to the 2nd last character, and so on.

When accessing indexes that is outside of reach, it will cause IndexError. Only integers that is allowed to pass as indexes, float or other types that can cause TypeError.

Untitled

Untitled

For Instance

Untitled

Implementation

"myskill" or 'myskill'
'myskill'
print("myskill providing course"[0])
m

<aside> 💡 Notice the difference when we put the certain indexation in the end, only print a single letter (Unicode).

</aside>