sexo = input("digite m ou f: ")
while sexo != 'f' and sexo != 'm':
     sexo = input("digite m ou f: ")
print(sexo)

#https://pt.stackoverflow.com/q/231075/101