Created
September 12, 2020 01:13
-
-
Save hebertcisco/6181fbe48cd4b6850b529d47ecc57edc to your computer and use it in GitHub Desktop.
Escrever um algoritmo que leia o nome e o sexo de 5 pessoas e informe o nome e se ela é homem ou mulher. No final informe total de homens e de mulheres.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def GenderOfThePerson(): | |
nome = raw_input("Insira um nome: ") | |
sexo = input( | |
"Qual o sexo de {Nome}? \n\n 1. Homem \n\n 2. Mulher\n\n".format(Nome=nome)) | |
if sexo == 1: | |
print("{Nome} é homem".format(Nome=nome)) | |
elif sexo == 2: | |
print("{Nome} é mulher".format(Nome=nome)) | |
else: | |
print("Resposta inválida!") | |
GenderOfThePerson() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment