The way the function was written, it returns no value, so the None. For her to return to string that you want to show, do:
def dif(x, z):
if x != z:
return '\nNúmeros diferentes';
else:
return '\nNúmeros iguais';
n1 = int(input('Um número: '))
n2 = int(input('Outro número: '))
print(dif(n1, n2))
Or else, do a function void, that returns no value, and that only shows the string on the screen, and call the function otherwise:
def dif(x, z):
if x != z:
print('\nNúmeros diferentes')
else:
print('\nNúmeros iguais')
n1 = int(input('Um número: '))
n2 = int(input('Outro número: '))
dif(n1, n2)
See working on repl.it
Before reaching the first final point I sent the vote of usefulness.
– Augusto Vasques