I am trying to remove a number of letters (depending on the input) from the end of a text from a file and then storing it in the same file:
f = open("fil