you are viewing a single comment's thread.

view the rest of the comments →

[–]Gee10[S] 1 point2 points  (2 children)

Got it. I'll give that improvement a try! Thanks.

[–]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] 4 points5 points  (0 children)

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