How can I modify a text file from a function and using recursion?

I have a function for example: to know about parts of cars, you should be able to see the elements of the list, but also be able to add and delete to the user's liking, and do all this using recursion and NOT the commands [while, for…]