运行 ❯
获取您的
自己的 Python
服务器
×
更改方向
更改主题,暗/亮
前往 Spaces
thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"] print(thislist[-4:-1]) #Negative indexing means starting from the end of the list. #This example returns the items from index -4 (included) to index -1 (excluded) #Remember that the last item has the index -1,
['orange', 'kiwi', 'melon']