{"id":41,"date":"2017-11-16T12:06:57","date_gmt":"2017-11-16T12:06:57","guid":{"rendered":"http:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/?page_id=41"},"modified":"2017-12-04T11:42:07","modified_gmt":"2017-12-04T11:42:07","slug":"functions","status":"publish","type":"page","link":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/functions\/","title":{"rendered":"Functions"},"content":{"rendered":"<p>This notebook will introduce the concept of **functions** in terms of the Python programming language. I will endevour to use examples of *chemistry* related problems, but occasionally examples from physics or mathematics will come through.<\/p>\n<p>Like many other programming languages Python lets you utilise functions -- is to have you have to write less code.<\/p>\n<p>The concept of a function should be familiar from mathematics, e.g.<\/p>\n<p><span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script><\/p>\n<p>where, <span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script> is some mathematical operation that acts on the argument, <span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script>. An example of a function is,<\/p>\n<p><span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script><\/p>\n<p>Using this we can say that <span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script>, <span class='MathJax_Preview'>\\(\\)<\/span><script type='math\/tex'><\/script>, etc.<\/p>\n<p>The use of\u00a0<strong>functions<\/strong> is an important paradigm in programming -- the following Jupyter notebook gives a quick introduction to functions \u00a0and how they can be used.<\/p>\n<p><a href=\"https:\/\/mybinder.org\/v2\/gh\/bjmorgan\/python_in_chemistry\/master?filepath=General%2FFunctions.ipynb\"><img decoding=\"async\" src=\"https:\/\/mybinder.org\/static\/images\/badge.svg\" alt=\"Launch this notebook using Binder\" \/><\/a><\/p>\n<p><a href=\"https:\/\/raw.githubusercontent.com\/bjmorgan\/python_in_chemistry\/master\/General\/Functions.ipynb\">Download this notebook<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This notebook will introduce the concept of **functions** in terms of the Python programming language. I will endevour to use examples of *chemistry* related problems, but occasionally examples from physics or mathematics will come through. Like many other programming languages...<\/p>\n","protected":false},"author":1040,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-41","page","type-page","status-publish","hentry"],"acf":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/Pd4Prp-F","_links":{"self":[{"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/pages\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/users\/1040"}],"replies":[{"embeddable":true,"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/pages\/41\/revisions"}],"wp:attachment":[{"href":"https:\/\/stg-universityofbathblogs-staging.kinsta.cloud\/python\/wp-json\/wp\/v2\/media?parent=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}