diff --git a/05_docstring/submissions/jeon193.py b/05_docstring/submissions/jeon193.py new file mode 100644 index 0000000..77f18b7 --- /dev/null +++ b/05_docstring/submissions/jeon193.py @@ -0,0 +1,14 @@ + +def afunc(array1, array2, mode: str = "+", pow: int = 2): + assert array1.shape == array2.shape, "size mismatch" + assert type(pow) == int, "pow should be type int" + + if mode == "+": + result = array1 + array2 + elif mode == "-": + result = array1 - array2 + else: + raise ValueError(f"mode is either '+' or '-' but got {mode}") + + result = result ** pow + return result