Hello. I started new project in python and i wanted to make a ATM in python so i asked my profesor for help because i didnt know how to save data in another file but now i ran in another problem and i am asking you for help. As you can see in the photo i have created new file saved.py and there is saved “money” for the “ATM”. But when i try to withdrawal it just deletes the data that is writen in saved.py and it says that it is not readable.
You are redefining variable “f” by opening it in the write mode, then your mistake is that you are trying to read a value of a writable file, that’s definitely an invalid operation
In your second if block of withdrawal, use a different identifier for the readable file #variable name
That way you will be dealing with different entities😊