diff --git a/.github/workflows/corretor_de_exercicios_secao_05.yml b/.github/workflows/corretor_de_exercicios_secao_05.yml index 89c00367c..97a1125be 100644 --- a/.github/workflows/corretor_de_exercicios_secao_05.yml +++ b/.github/workflows/corretor_de_exercicios_secao_05.yml @@ -19,3 +19,7 @@ jobs: if: always() run: | python -m doctest -f secao_05_exercicios_funcoes/ex_01_piramide.py + - name: Correção do Exercício 01 da seção de Funções + if: always() + run: | + python -m doctest -f secao_05_exercicios_funcoes/ex_04_p_ou_n.py diff --git a/secao_05_exercicios_funcoes/ex_04_p_ou_n.py b/secao_05_exercicios_funcoes/ex_04_p_ou_n.py new file mode 100644 index 000000000..23e84c94f --- /dev/null +++ b/secao_05_exercicios_funcoes/ex_04_p_ou_n.py @@ -0,0 +1,21 @@ +""" +Exercício 04 da seção de funções da Python Brasil: +https://wiki.python.org.br/ExerciciosFuncoes + +Faça um programa, com uma função que necessite de um argumento. +A função retorna o valor de caractere ‘P’, se seu argumento for positivo, +e ‘N’, se seu argumento for zero ou negativo. + + >>> positivo_negativo(2) + 'P' + >>> positivo_negativo(-1) + 'N' + >>> positivo_negativo(0) + 'N' + >>> positivo_negativo(-100) + 'N' + >>> positivo_negativo(90) + 'P' + +""" +