约 306 字
约 2 分钟
说明:计算绝对值。
def abs(x): ''' 计算参数的绝对值 :param x: 要计算的值 :return: x 的绝对值 '''
示例:
print(abs(-100)) print(abs(-233.3333)) print(abs(0)) print(abs(128)) 运行代码>>> Establishing WebAssembly Runtime. >>> Standby. Powered by Shift.
print(abs(-100)) print(abs(-233.3333)) print(abs(0)) print(abs(128))
>>> Establishing WebAssembly Runtime.
>>> Standby.
Powered by Shift.
创建于 2025/5/9
更新于 2025/5/11