{"id":37216,"date":"2016-08-29T11:11:17","date_gmt":"2016-08-29T16:11:17","guid":{"rendered":"http:\/\/union20.wordpress.com\/?p=120"},"modified":"2016-08-29T11:11:17","modified_gmt":"2016-08-29T16:11:17","slug":"functions-not-to-fx","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/functions-not-to-fx\/","title":{"rendered":"Functions, not = to f(x)"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/union20.wordpress.com\/2016\/08\/29\/functions-not-to-fx\/\"><a href=\"https:\/\/union20.wordpress.com\">PYTHON 3 <\/a><\/a><\/em><br \/><\/p>\n<p>Before creating and calling functions in Python 3, first we have to know what is a function in Python 3? So&#8230;.<\/p>\n<p>What is a function in Python 3?<\/p>\n<p>A function is a code, (reusable code) that let us make a single related action. For example, the most common function I may think of is &#8220;print()&#8221; which is also an output, but Python let us create our very own functions\/commands\/methods.<\/p>\n<p>So now we now what a function is, but now, how do we create a function?<\/p>\n<p>To create a function first of all your are going to NEED the KEYWORD &#8220;<em>def<\/em>&#8221; (an abbreviation of the word define) which is indispensable to create a function, &#8217;cause like the name says it you are going to define it, the next thing you need is the name of your function, so name it anyway you like, but I recommend its a name that reminds you what that function does or at at least is supposed to do lol. And at the end you add parentheses &#8220;()&#8221;, and inside this parentheses there should be the parameters\/arguments of that function.<\/p>\n<p>Here&#8217;s a more graphical example of how to create a function:<\/p>\n<p><em>&#8220;def&#8221; + &#8220;nameofthefunction&#8221; + &#8220;(parameters\/arguments)&#8221;<\/em><\/p>\n<p><img class=\"alignnone size-full wp-image-149\" src=\"https:\/\/union20.files.wordpress.com\/2016\/08\/screenshot-from-2016-08-29-11-04-41.png?w=840\" alt=\"Screenshot from 2016-08-29 11-04-41\"   \/><\/p>\n<p>That is my creatingandcallingfunctions.py file and when I run it on the terminal it is suppose to print 14 lines of series of numbers.<\/p>\n<p><img class=\"alignnone size-full wp-image-156\" src=\"https:\/\/union20.files.wordpress.com\/2016\/08\/screenshot-from-2016-08-29-11-08-25.png?w=840\" alt=\"Screenshot from 2016-08-29 11-08-25\"   \/><\/p>\n<p>and we are done<img src=\"https:\/\/s0.wp.com\/wp-content\/mu-plugins\/wpcom-smileys\/twemoji\/2\/72x72\/1f642.png\" alt=\"?\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/union20.wordpress.com\/120\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/union20.wordpress.com\/120\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=union20.wordpress.com&#038;blog=115237589&%23038;post=120&%23038;subd=union20&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at PYTHON 3 Before creating and calling functions in Python 3, first we have to know what is a function in Python 3? So&#8230;. What is a function in Python 3? A function is a code, (reusable code) that let us make a single related action. For example, the most common function I &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/functions-not-to-fx\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Functions, not = to f(x)<\/span><\/a><\/p>\n","protected":false},"author":29,"featured_media":149,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[89,148],"class_list":["post-37216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-python3","tag-learning"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=37216"}],"version-history":[{"count":4,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37216\/revisions"}],"predecessor-version":[{"id":38032,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37216\/revisions\/38032"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=37216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=37216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=37216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}