Install PyCharm, start a new project, and then copy/paste the code below inside main.py
with open("names.txt", "r+") as f:
lines = f.readlines()
for i in range(len(lines)):
lines[i] = "Hello, " + lines[i]
f.seek(0)
f.writelines(lines)
The code opens an already existing names.txt file, reads all the names inside it, adds "Hello, " in front of each name, and then writes the resulting strings to the file.
The only problem is... we don't have a names.txt file! Fortunately, it is very easy to create one from scratch.