I think, if I am reading it correctly, that was not a code example, that was actual code. count and nums are variables being defined, and fib is a function. Then the function is being called to build the table (you can see str(fib(n)) in the second to last line)
So if you wanted to handle file read/write errors you would need to implement signal handlers.
https://stackoverflow.com/questions/6791415/how-do-memory-ma...