How to get Last Character in Python String?

preview_player
Показать описание
To get the last character in the string in Python, we can use "string indexing" using square brackets.

x[len(x) - 1] or x[-1]

This expression returns the last character in the string.

References
=========
Python tutorial to get the last character in the string

Python tutorials
Рекомендации по теме
visit shbcf.ru