+ 5
Code for Python to Write/Read and Using data from file ; any suggestions can you make me to understand what we can do more?
I just learned Python and this functional paradigm changed my way of thinking of programming. And I tried to make this simple but easy to understand file based code ; I hope you enjoy it https://code.sololearn.com/cbM891WJbXEC/?ref=app
2 Respuestas
+ 2
Good code.
Sugestion:
If you would like, you could use the 'with' context manager instead of try/finally block. It is simpler to use:
with open(filename, mode) as f:
f.write(string_to_be_writen)
...
I use 'f' here but you can use any variable name.
The file is closed automatically when the block ends.
0
nice start.
One suggestion: never try to parse CSV code yourself. Or embrace the spaghetti code. Just saying that for your own sake