{"id":37758,"date":"2016-09-14T22:44:23","date_gmt":"2016-09-15T03:44:23","guid":{"rendered":"http:\/\/a00344371.wordpress.com\/?p=147"},"modified":"2016-09-14T22:44:23","modified_gmt":"2016-09-15T03:44:23","slug":"creating-functions","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/creating-functions\/","title":{"rendered":"Creating Functions"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/a00344371.wordpress.com\/2016\/09\/15\/creating-functions\/\"><a href=\"https:\/\/a00344371.wordpress.com\">Programming Fundaments<\/a><\/a><\/em><br \/><\/p>\n<p>To create a function \u00a0after you call it, you must set the parameters list, or the arguments, and after you call the function you must use the command return(). For a better explanation here is an example:<\/p>\n<pre>def fahrenheit(T_in_celsius):\n    \"\"\" returns the temperature in degrees Fahrenheit \"\"\"\n    return (T_in_celsius * 9 \/ 5) + 32\n\nfor t in (22.6, 25.8, 27.3, 29.8):\n    print(t, \": \", fahrenheit(t))<\/pre>\n<p>In this function you are defining the parameters list as T_in_celsius, and defining \u00a0the t as a list of numbers, which are you celsius numbers, ands it will be converted in fahrenheit, and you will use the return comand to make it repeat the steps with all of the umbers of the list, as you can observe in the next part:<\/p>\n<pre>22.6 :  72.68\n25.8 :  78.44\n27.3 :  81.14\n29.8 :  85.64\n<\/pre>\n<p>And thats how you create a function, as you can see its knda difficult in the beginning but after a couple trials and errors you can master this in no time<\/p>\n<p>More information and examples at:\u00a0http:\/\/www.python-course.eu\/python3_functions.php<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/a00344371.wordpress.com\/147\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/a00344371.wordpress.com\/147\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=a00344371.wordpress.com&#038;blog=115285426&%23038;post=147&%23038;subd=a00344371&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Programming Fundaments To create a function \u00a0after you call it, you must set the parameters list, or the arguments, and after you call the function you must use the command return(). For a better explanation here is an example: def fahrenheit(T_in_celsius): &#8220;&#8221;&#8221; returns the temperature in degrees Fahrenheit &#8220;&#8221;&#8221; return (T_in_celsius * &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/creating-functions\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Creating Functions<\/span><\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[37,24,33],"class_list":["post-37758","post","type-post","status-publish","format-standard","hentry","category-blogs","category-syndicated","tag-programming","tag-python","tag-tc101"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37758","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\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=37758"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37758\/revisions"}],"predecessor-version":[{"id":37759,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37758\/revisions\/37759"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=37758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=37758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=37758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}