From b2e2b049b8d7ea0298bc31ac28a48453f3e4f07e Mon Sep 17 00:00:00 2001 From: rahini Date: Fri, 7 Nov 2025 15:14:40 +0530 Subject: [PATCH] fix :handle mixed string and interger types in add() --- python bug_report.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 python bug_report.py diff --git a/python bug_report.py b/python bug_report.py new file mode 100644 index 000000000..e32dddd01 --- /dev/null +++ b/python bug_report.py @@ -0,0 +1,4 @@ +def add(a, b): + if not isinstance(a, (int, float)) or not isinstance(b, (int, float)): + raise TypeError("Both arguments must be numbers.") + return a + b