From b2f792de5061a03d99fa4ba4e5a848f7331ce3de Mon Sep 17 00:00:00 2001 From: nattokimuchi710 Date: Tue, 11 Feb 2025 23:53:54 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E8=BF=BD=E5=8A=A0=E3=81=8A=E3=82=88=E3=81=B3calc?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calc_mul.py | 26 +++++++++++++++----------- test_cases.py | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/calc_mul.py b/calc_mul.py index b55a367..27a1516 100755 --- a/calc_mul.py +++ b/calc_mul.py @@ -3,19 +3,23 @@ import re def calc(A,B): - ai=str(A) - bi=str(B) - p = re.compile('\d+(\.\d+)?') - if p.match(ai) or p.match(bi): - a=float(ai) - b=float(bi) - if 0