从第n项开始到列表python的末尾

您好,我想知道如何在 python 中执行以下操作


假设我们有这些列表


["Apples","Pears","Oranges","Grapes"]

["Apples","Pears","Oranges","Grapes","Strawberries"]

["Apples","Pears","Oranges","Pumpkins","Cherries","Lemons"]

我想提取以提取第 4 个元素及以后的元素。所以...


["Grapes"]

["Grapes","Strawberries"]

["Pumpkins","Cherries","Lemons"]

这些列表都将包含 3 个以上的元素。


我该怎么做?


翻过高山走不出你
浏览 95回答 1
1回答

ABOUTYOU

fruits = ["Apples","Pears","Oranges","Pumpkins","Cherries","Lemons"] print(fruits[3:])
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python