📌  相关文章
📜  获取字符串结尾python代码示例

📅  最后修改于: 2022-03-11 14:45:26.728000             🧑  作者: Mango

代码示例1
a = "abcde"
lastChar = a[-1]
print(f'Using index, lastChar is {lastChar} , using slice last char = { a[len(a)-1::] } = { a[len(a)-1] } = { a[:-2:-1] }') 
'''
output
Using index, lastChar is e , using slice last char = e 
'''