4
I’m learning Python and I’ve been creating txt files, adding things and rewriting them but n managed to modify a specific line, how can I do this?? and also I wanted to know how to find out on which line a string specifies this, I can already search but n managed to make the program find the line where the string is :|
to search I enstou using...
palavra = input('palavra a pesquisar ')
for line in open('perfil.txt'):
if palavra in line:
print(line)
Possible duplicate of Is there any way to overwrite a specific line of a text file using Python?
– Woss