Skip to content

Instantly share code, notes, and snippets.

@hebertcisco
Created September 12, 2020 01:13
Show Gist options
  • Save hebertcisco/6181fbe48cd4b6850b529d47ecc57edc to your computer and use it in GitHub Desktop.
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.
#!/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