国际访客建议访问 Primers 编程伙伴 国际版站点 > Python 教程 > tuple 以获得更好的体验。

# tuple

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

说明:类型转换为 tuple

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

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

示例:

运行示例

print(tuple([1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6]))
本文 更新于: 2025-06-19 01:16:01 创建于: 2025-06-19 01:16:01