From 3f405ff29f1b6ca18527c3470278f0f755b968b2 Mon Sep 17 00:00:00 2001 From: 27825 <2782512136@qq.com> Date: Sun, 29 Mar 2026 19:54:34 +0800 Subject: [PATCH] add test.py with multiply function --- test.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..66ab7c8 --- /dev/null +++ b/test.py @@ -0,0 +1,25 @@ +def multiply(a, b): + """ + 计算两个数字的乘积 + + 参数: + a (int/float): 第一个数字 + b (int/float): 第二个数字 + + 返回: + int/float: a和b的乘积 + """ + return a * b + +# 示例使用 +if __name__ == "__main__": + # 测试函数 + result = multiply(5, 3) + print(f"5 * 3 = {result}") + + # 更多测试 + result2 = multiply(2.5, 4) + print(f"2.5 * 4 = {result2}") + + result3 = multiply(-2, 3) + print(f"-2 * 3 = {result3}") \ No newline at end of file