Python 遍历元组
遍历元组
你可以通过使用 for 循环来遍历元组中的项目。
实例
遍历项目并打印值:
thistuple = ("apple", "banana", "cherry")
for x in thistuple:
print(x)
你可以在我们的 Python For 循环 这一章中学习更多关于 for 循环的内容。
你可以通过使用 for 循环来遍历元组中的项目。
遍历项目并打印值:
thistuple = ("apple", "banana", "cherry")
for x in thistuple:
print(x)
你可以在我们的 Python For 循环 这一章中学习更多关于 for 循环的内容。