📅  最后修改于: 2022-03-11 14:45:26.728000             🧑  作者: Mango
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
'''