lo que intento con el try, es que si escribís un numero te meta en el while(ponele si le pongo !=str se mete en un bucle infinito, y si pongo ==int no entra), como lo harían ustedes. (pd: perdón por no saber explicarme bien)
def x(qe):
try:
q=input(qe)
while q!=str:
q=input(qe)
print("funciona")
except typeError:
print("ingresaste cualquier cosa")
return q
w='introduce tu nombre:'
w=x(w)
print(w)
if w=="hola":
print("hola")
type(q) == int
(aunque tampoco te funcionará)