\n
This post is very useful. As we can see many times we face different problems that need a solution of the ones before, or to use it as a step to solve a bigger problem. The point is that defining functions is not the only way to reuse code.<\/p>\n
Python has the advantage of saving our previous files and use them as a module, like the one we import to use some math functions. So in order to use some previously defined functions we create a Python file and import it in another to make use of its content!<\/p>\n
I will use two of our previous programs to help me prove this. In order to calculate the standard deviation we had to use the factorial of a number. So instead of going to our old factorial code we could have just imported it and made use of it!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"
This post is very useful. As we can see many times we face different problems that need a solution of the ones before, or to use it as a step to solve a bigger problem. The point is that defining functions is not the only way to reuse code.Pyt… Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":39,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,25],"tags":[],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/10849"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/comments?post=10849"}],"version-history":[{"count":8,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/10849\/revisions"}],"predecessor-version":[{"id":18996,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/10849\/revisions\/18996"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/media?parent=10849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/categories?post=10849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/tags?post=10849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}