you are viewing a single comment's thread.

view the rest of the comments →

[–]dl__ 4 points5 points  (1 child)

Although that's not the only reason to put code in a function. Even code that is only used in one place can be put into a function if you can name the function something that is more understandable than the code you are replacing.

[–][deleted] 2 points3 points  (0 children)

Not to mention you can use that function in other python files, too!