访问元组项,您可以通过在方括号内引用索引号来访问元组项:示例,打印元组中的第二个项:```Pythonthistuple = ("apple", "banana", "cherry")print(thistuple1...在指定范围时,返回值将是一个包含指定项的新元组。...如果省略起始值,则范围将从第一项开始:示例,此示例返回从开头到“kiwi”之前(但不包括)的项:```Pythonthistuple = ("apple", "banana", "cherry", "orange...", "kiwi", "melon", "mango")print(thistuple:4)如果省略结束值,范围将一直到列表的末尾:示例,此示例返回从“cherry”到末尾的项:```Pythonthistuple..."banana", "cherry", "orange", "kiwi", "melon", "mango")print(thistuple2:)如果要从元组末尾开始搜索,请指定负索引:示例,此示例返回从索引