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

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

描述

long() 函数将数字或字符串转换为一个长整型。

Python3.x 版本已删除 long() 函数。

语法

以下是 long() 函数语法:

claSS long(x, base=10)

参数

x — 字符串或数字。

base — 可选,进制数,默认十进制。

返回值

返回长整型数。

实例

以下实例展示了 long() 的使用方法:

云计算开发:Python内置函数-long() 函数详解

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.

登录免费注册