运行 ❯
获取你自己的
Python
服务器
×
更换方向
更换主题,深色/浅色
访问 Spaces
thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango") print(thistuple[-4:-1]) #Negative indexing means starting from the end of the tuple. #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')