1. Try to give the objects some meaningful names, like when I create a list containing a list of fruit. Then we cab type: fruit=['kiwi','orange','pear'], instead b=['kiwi','orange','pear'].
2. Give the files some handles before reading them in, like:
file1="aaa.txt"
file2="bbb.txt"
So when you change the file names to be read in, just change the handles.
3. When a piece of code is repeatedly used, we can code them into functions, or classes etc.
No comments:
Post a Comment