A file 'webiste.txt' contains text:
welcome to geeksforgeeks
Python code:
f = open('website.txt', 'a')
f.seek(11)
f.write("Python")
f.close()
desired out: welcome to python geeksforgeeks
real output: welcome to geeksforgeekspython
when I am running this code in 'a' mode the data gets appended at the last position not at 11th position. In 'w' mode the data gets entered at position 11th but rest of the data overwritten.
How can we add python at 11th index without overwriting?