Skip to content

tuple

请查看 Python 内建函数列表 了解更多相关 API。

说明:类型转换为 tuple

python
def tuple(x):
    '''
    类型转换为 tuple

    :param x: 一个变量
    :return: 转换为 tuple 后的值
    '''

示例:

python
print(tuple([1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6]))