Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/corretor_de_exercicios_secao_05.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 21 additions & 0 deletions secao_05_exercicios_funcoes/ex_04_p_ou_n.py
Original file line number Diff line number Diff line change
@@ -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'

"""