From d747c9608e675b2cdbc9ea404c51f891a6c146e2 Mon Sep 17 00:00:00 2001 From: lyr <3354326668@qq.com> Date: Fri, 27 Mar 2026 13:52:20 +0800 Subject: [PATCH] Add multiply function in test.py --- test.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..b0e7dc0 --- /dev/null +++ b/test.py @@ -0,0 +1,21 @@ +def multiply(a, b): + """ + 计算两个数字的乘积并返回结果。 + + 参数: + a (int/float): 第一个数字 + b (int/float): 第二个数字 + + 返回: + int/float: a和b的乘积 + """ + return a * b + + +if __name__ == "__main__": + # 测试代码 + print("测试 multiply 函数:") + print(f"2 * 3 = {multiply(2, 3)}") + print(f"4.5 * 2 = {multiply(4.5, 2)}") + print(f"-5 * 6 = {multiply(-5, 6)}") + print(f"0 * 100 = {multiply(0, 100)}") \ No newline at end of file