Python3 tuple 函数

Python3 内置函数 Python3 内置函数


描述

tuple 函数将列表转换为元组。。

语法

以下是 tuple 的语法:

tuple( seq )

参数

  • seq -- 要转换为元组的序列。

返回值

返回元组。


实例

以下展示了使用 tuple 的实例:

实例

>>>list1= ['Google', 'Taobao', 'Runoob', 'Baidu'] >>> tuple1=tuple(list1) >>> tuple1 ('Google', 'Taobao', 'Runoob', 'Baidu')

Python3 内置函数 Python3 内置函数