From 0c779094d073b2a8e2821e93490583edb9b77673 Mon Sep 17 00:00:00 2001 From: VictorVangeli Date: Thu, 3 Oct 2024 11:57:38 +0300 Subject: [PATCH] update 'calc.py' --- brain_games/__pycache__/utils.cpython-310.pyc | Bin 734 -> 741 bytes .../games/__pycache__/calc.cpython-310.pyc | Bin 2013 -> 2017 bytes .../games/__pycache__/engine.cpython-310.pyc | Bin 2211 -> 1336 bytes brain_games/games/calc.py | 17 +++++++---------- .../__pycache__/brain_calc.cpython-310.pyc | Bin 563 -> 423 bytes 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/brain_games/__pycache__/utils.cpython-310.pyc b/brain_games/__pycache__/utils.cpython-310.pyc index 0b3df1699ea7065af8fd21338a3ea687d47a0dba..1689c2bdb5ee507f1fce6a54f558948b9cbaf29b 100644 GIT binary patch delta 221 zcmcb|`jnM7pO=@50SIOU{!80GkyqAC0mw;VNMX!j$YqRTWMoL;NMT83N@Gf4O<`+c zjbct=4`$Hhdxy1%DH$S%sWaceq kpao!6MVufd2m)l$Ee@O9{FKt1R69l>uNY(q4}%CZ0J!Qe761SM delta 213 zcmaFLdXJSipO=@50SH8Ad`jCnkylnj2FOWaNMX!jh+;@#Phm-AOk+x6O<`+cjbch+ z3}(>ecnMPPH!(q3j0MPW2I68KAW_1wfU$<5hH>G>=|PODnoPIYiW2iu@^houL3Czb z2~dc&xFoTt_B92K+z5YC0MIZ-gG8HiasUl_&o4JS;NZn!vY643Zae$-{ b1Sd$A!zMRBr8FnijuFT!204X;L4+9qPkJq# diff --git a/brain_games/games/__pycache__/calc.cpython-310.pyc b/brain_games/games/__pycache__/calc.cpython-310.pyc index 675edffb86e1b571d626940d09f6cc747007064a..1627ea8c7affbfeeab7e19fc11939079b059cdee 100644 GIT binary patch delta 954 zcmZ`%y>HV%6u&z=j^jA4`T^pj1-AoI=m!!Lswx&hWnzE@1tH6goivi;ROd6OlB2e1 z2M{b#HYy}wV?haNxU?5nZ z@9$SgwrvgL`S$qeO^iI`s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>{S0hfPvrL diff --git a/brain_games/games/__pycache__/engine.cpython-310.pyc b/brain_games/games/__pycache__/engine.cpython-310.pyc index c8449e0185ccc4fe5ce93f72635ed6e7353c1c6e..5de5ea966008f7f6ae6ed79a495c93acd21db137 100644 GIT binary patch delta 592 zcmY*W&ui2`6rP!6l5BKkw^&fTq*YqNF5;yXq*!4u9!f!aauJrWlPFtA3e}&y14H$pwsCa=7r{XWgX3lez}0zzky0)%6=c1zcb>eT3+6>R-^(cKHxrt}m{yukON4WRSC>LRS2ougFXy+Nh=v10E90E%_#Z7zwwHa*W+BNJX@Nsluw*3#UoSGrPA!X<*CZq(#*_> zsZu;V{lU5NshLXo+}V?*>6zHN)NsS77WnaSHQ?N>Mitu+FS|Up8llU5d(n+e?nVvn zS9P+`YX(LWeG)x94-p}NrgBrcrLC%}5~&Wx+uEfHxzCVmuaVgtR^Sz%&bw8ewYRnhKT zW8wi8_d3_bCdPHK)>#oPtiNMo3umN+-B#yn=SFh3CGLne!_^hJzf#Ca11I=GI3Z_b zZZ|#bNEq?_1QXxySsZ6#TV8MD(Qn0FCjRKG!Z+#JX3x!?r}|as8~K0c`=)*te~PUn zR&hTuKw+%G-7OjDPO_PbfLx}w`|bK~{e%~8Jk1pxY~Vq8P6@h(7V6(j8B3Uim!;`6$C*S3ffS|cW<~v`D z7CUWwp_^o?oBOa=s}rm{^l{MOEGbnit;wW#56^bhvF__*tQNA%Jn$EKD(uZ81=iEq z-MVatY^T-hM{sgjC1rzg*QAmtZLZUZNyI$n1uK`CXTwSMS!-1 zsTKjA%Q`@;Nf7G^TqC8KoEs6~d`kJ`*s{@7R+aPGa%S0tw$aS=NkVg=bK3+-WI+o6CG1i}E^QNZ0tSTcV0u@w;!tC|PaHQ<)pt-@+hUC> z><)o84PjJV4w$u@%MW5}E?dPsa(RMvwUR>rb99d|pNJPQ ziwEkSy(B^U3YOuk5XOL|S}KsJ4r)1dm}VH$h&0s$8h;t8<-8S-rf^=UB8EtMoCHAr n#yYlQgD6%4S>8 int: +def get_random_math_sign_and_result(number_one: int, + number_two: int, + operation: int) -> int: """ Вычисляет результат математической операции между двумя числами. Args: number_one (int): Первое число. number_two (int): Второе число. - operation (str): Операция, которую нужно выполнить ('+', '-', '*'). + operation (int): Операция, которую нужно выполнить ('+', '-', '*'). Returns: int: Результат выполнения операции. """ - match operation: - case "+": - return number_one + number_two - case "-": - return number_one - number_two - case "*": - return number_one * number_two + result = eval(f"{number_one} {operation} {number_two}") + return result def get_numbers_and_calculation_result() -> tuple[str, str]: @@ -41,7 +38,7 @@ def get_numbers_and_calculation_result() -> tuple[str, str]: operation = random.choice(["+", "-", "*"]) question = f"{number_one} {operation} {number_two}" correct_answer = str( - get_calculation__result(number_one, number_two, operation)) + get_random_math_sign_and_result(number_one, number_two, operation)) return question, correct_answer diff --git a/brain_games/scripts/__pycache__/brain_calc.cpython-310.pyc b/brain_games/scripts/__pycache__/brain_calc.cpython-310.pyc index a62cc8cd3213cfec1561ca2e3c75c5b90aac9fab..703d02695fbf70c1b8f517977ec7dae7fc6a6b47 100644 GIT binary patch delta 275 zcmYjLOAY}+5UuKNGMVU=#LfZ6!U@F2o`v0PI%9eW=9BcWVPU}qoIPqVn$X1i*e1F#6LysB@7IP>tMg%LYJV7inY1LY|b|#KMXk+R;xfKaEg*s=f`QsRn2IKu1V=07*iz6 z(wK3i;?B%*%_?>O6Is?tzW=S4G&SbS$pg>c@MMFcvfDfx@=N}m76dX-A*$CKK>j#5 literal 563 zcmZWlO-sW-5Zz7EG?upD4-kX59GXz@B8aF}6f8Yh>LHgUCfi!wWW#O>=3M`be<@c_ zf;VqobS6a_=)inE9y4!7_Ie!xb~pT*e?$JjrfCK==ivGhLP8QMNJ>LWu{MN}nxR?O zrm)gh*n-+hT5lw@c{{OR40XuuH376et=)4zVGi+V)frukN9=w!zMf(iM5));=uV5Yg!!9$cS zxL5{PGG3)TD|B$nUj;9Mq3_