2
Hello
I’d like to know how I compare a user-typed string with the strings contained in a file. txt
My last attempt was like this , but I did not get the result I wanted:
f = open("Testando.txt","r")
r = f.readline()
nome = input ("Digite qualquer coisa : ")
for line in r :
if line == nome :
print("já existe um nome igual")
else :
print("Obrigado pela nova interação")
input("Pressione em qualquer tecla para sair do programa")
f.close()*
Thank you for your attention. :)
It worked out, thank you very much !! :)
– SZJ08
You’re welcome @SZJ08, I’m glad you solved
– Miguel