{"id":37621,"date":"2016-09-12T08:43:42","date_gmt":"2016-09-12T13:43:42","guid":{"rendered":"http:\/\/firstprogrammingsteps.wordpress.com\/?p=165"},"modified":"2016-09-12T08:43:42","modified_gmt":"2016-09-12T13:43:42","slug":"library","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/library\/","title":{"rendered":"Library"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/firstprogrammingsteps.wordpress.com\/2016\/09\/12\/library\/\"><a href=\"https:\/\/firstprogrammingsteps.wordpress.com\">Hackerman&amp;#039;s house<\/a><\/a><\/em><br \/><\/p>\n<p>A library is a built-in module that can be used to solve several problems. Once python is installed it includes a series of standard libraries such as math that can be used to solve mathematical problemas or generally just to work better with numbers. There is also the time library to count the time. You can find more information about it here.<\/p>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/\" rel=\"nofollow\">https:\/\/docs.python.org\/3\/library\/<\/a><\/p>\n<p>In this example we&#8217;ll be importing the &#8220;math&#8221; librarie to calcule the area of a circle, the radius will be given by the user and the program will substitute this number in a formula<\/p>\n<p>Import a librarie is simple, the syntax is this:<\/p>\n<blockquote><p>import name_of_the_library<\/p><\/blockquote>\n<p>And the functions included in every library are different, these functions can be find in the link above.<\/p>\n<p>The functions of math that we&#8217;ll be using is the pi value.<\/p>\n<p><img class=\"alignnone size-full wp-image-199\" src=\"https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/09\/libraries.jpg?w=736\" alt=\"libraries\"   \/><\/p>\n<p>The &#8220;try&#8221; and &#8220;except&#8221; are used to determine if the input given by the user is a number. The radius is given by the user and the area has a simple formula PI times radius square. That is why we needed the math module.<\/p>\n<p>Here is how the program works.<\/p>\n<p><img class=\"alignnone size-full wp-image-203\" src=\"https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/09\/libraries2.jpg?w=736\" alt=\"libraries2\"   \/><\/p>\n<p>Thanks for reading me.<\/p>\n<p><img class=\"alignnone size-full wp-image-166\" src=\"https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/09\/giphy-5.gif?w=736\" alt=\"giphy-5\"   \/><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/firstprogrammingsteps.wordpress.com\/165\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/firstprogrammingsteps.wordpress.com\/165\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=firstprogrammingsteps.wordpress.com&#038;blog=115170367&%23038;post=165&%23038;subd=firstprogrammingsteps&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Hackerman&amp;#039;s house A library is a built-in module that can be used to solve several problems. Once python is installed it includes a series of standard libraries such as math that can be used to solve mathematical problemas or generally just to work better with numbers. There is also the time library &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/library\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Library<\/span><\/a><\/p>\n","protected":false},"author":22,"featured_media":199,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[221,185,195,222,24,33],"class_list":["post-37621","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-dab","tag-libraries","tag-library","tag-module","tag-python","tag-tc101"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37621","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\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=37621"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37621\/revisions"}],"predecessor-version":[{"id":38155,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37621\/revisions\/38155"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=37621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=37621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=37621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}