filmov
tv
How to get Last Character in Python String?

Показать описание
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
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