python list中的最后一个元素
# To get the last element in a list you use -1 as position
bikes = ['trek', 'redline', 'giant']
bikes[-1]
# Output:
# 'giant'
python打印最后3
message = iloveyouchina
#get last x words
#for example x = 3
print(message[-3:]
python列表的最后一个元素
# to print the last item from a list
print(list[-1])