diff --git a/README.md b/README.md index 0912af1..0d43107 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,31 @@ -# package_name +# calculadora_MaOtg Description. -The package package_name is used to: - - - - +The package calculadora_MaOtg is used to: + Calcular: + - Soma + - Subtração + - Multiplicação + - Divisão + - Potência ## Installation Use the package manager [pip](https://pip.pypa.io/en/stable/) to install package_name ```bash -pip install package_name +pip install calculadora_MaOtg ``` ## Usage ```python -from package_name import file1_name -file1_name.my_function() +from calculadora_MaOtg import calcular as calc +calc.soma(a, b) ``` ## Author -My_name +Mateus O Mendes ## License [MIT](https://choosealicense.com/licenses/mit/) \ No newline at end of file diff --git a/package_name/__init__.py b/calculadora_MaOtg/__init__.py similarity index 100% rename from package_name/__init__.py rename to calculadora_MaOtg/__init__.py diff --git a/calculadora_MaOtg/calcular.py b/calculadora_MaOtg/calcular.py new file mode 100644 index 0000000..a6d694a --- /dev/null +++ b/calculadora_MaOtg/calcular.py @@ -0,0 +1,33 @@ +def _retorno(): + return ")= Verificação da validade dos valores resultou em erro, confira novamente os valores fornecidos na função. =(" + +def soma(a, b): + if isinstance(a, (int, float)) and isinstance(b, (int, float)): + return a + b + else: + return _retorno() + + +def subtracao(a, b): + if isinstance(a, (int, float)) and isinstance(b, (int, float)): + return a - b + else: + return _retorno() + +def multiplicacao(a, b): + if isinstance(a, (int, float)) and isinstance(b, (int, float)): + return a * b + else: + return _retorno() + +def divisao(a, b): + if isinstance(a, (int, float)) and isinstance(b, (int, float)): + return a / b + else: + return _retorno() + +def potencia(a, b): + if isinstance(a, (int, float)) and isinstance(b, (int, float)): + return a ** b + else: + return _retorno() \ No newline at end of file diff --git a/package_name/file1_name.py b/package_name/file1_name.py deleted file mode 100644 index e69de29..0000000 diff --git a/package_name/file2_name.py b/package_name/file2_name.py deleted file mode 100644 index e69de29..0000000 diff --git a/setup.py b/setup.py index 4b4dc95..5ee7189 100644 --- a/setup.py +++ b/setup.py @@ -7,14 +7,14 @@ requirements = f.read().splitlines() setup( - name="package_name", + name="calculadora_MaOtg", version="0.0.1", - author="my_name", - author_email="my_email", + author="Mateus O Mendes", + author_email="ortega.mat@outlook.com", description="My short description", long_description=page_description, long_description_content_type="text/markdown", - url="my_github_repository_project_link" + url="https://github.com/MaOtg/simple-package-template", packages=find_packages(), install_requires=requirements, python_requires='>=3.8',