Optional Tuple Return Types 返回类型 ; 可选元组返回类型
The collection of objects can be any Python container type, including the tuple, string, and list types discussed in earlier articles.
对象集合可以是任何 Python 容器类型,包括前面文章中讨论的 tuple、string 和 list 类型。
You can use the for loop with any Python object that provides an iterator, including the built-in sequence types such as the tuple, string, and list.
可以将for循环与提供迭代器的任何Python对象结合使用,这些对象包括tuple、string和list等内置序列类型。
In Listing 2, you can see that each element in a tuple can be of a different type, but the types in a list must be homogeneous.
在清单2中,可以看到tuple中的每个元素可以是不同类型的,但列表中的元素必须是相同类型的。
应用推荐