互联网技术 / 互联网资讯 · 2024年1月22日

Python内置函数-tuple()函数的云计算开发指南

描述

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

语法

以下是 tuple()方法的语法:

tuple( ITeRable )

参数

ITeRable — 要转换为元组的可迭代序列。

返回值

返回元组。

实例

以下实例展示了 tuple()函数的使用方法:

以上实例输出结果为:

Tuple eleMents : (123, ””xyz””, ””zaRa””, ””abc””)

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册