f = open('kk.txt', 'r')
data = f.read()
data = data.replace('hola', 'hello')
f.close()
f = open('kk.txt', 'w')
f.write(data)
f.close()
Python newbie: trying to create a script that opens a file and replaces words