{"id":188,"date":"2017-07-20T02:41:29","date_gmt":"2017-07-20T01:41:29","guid":{"rendered":"http:\/\/192.168.1.18\/?page_id=188"},"modified":"2017-07-20T12:32:13","modified_gmt":"2017-07-20T11:32:13","slug":"python-comments","status":"publish","type":"page","link":"http:\/\/www.bulis.co.uk\/?page_id=188","title":{"rendered":"Python: Comments"},"content":{"rendered":"<p>Comments allow software developers to document their code within the code itself. This is especially useful when modifying existing code written by other developers; to be able to read a brief description of what the code is trying to accomplish rather than waste time deciphering source code. There are two ways to define a comment in Python we can use either the <strong>#<\/strong> (hash sign) which creates a comment to a single line or for multiple lines we use the <strong>&#8221;&#8217;<\/strong> three (single quotes). The computer ignores these comments when the program is executed.<\/p>\n<p>This is an exmple of how to use three single quotes to comment for more detailed descriptions. These types of comments usually appear at the top of the code and describe the developer, date and a brief description of the what the code does:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n'''\r\nWritten by: Phantom Rasberry Blower\r\nDate: 12\/03\/2002\r\nThis is an exmple of comments using\r\nmultiple lines that start with\r\nthree single quotes and end with\r\nthree single quotes.\r\n'''\r\n<\/pre>\n<p>The next example shows how to comment single lines using the hash sign:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# These comments are ignored by the computer when the program is executed\r\npi = 3.14159265359  # Comments can also be placed next to code\r\n# But not before! pi = 3.14159265359 (This won\u2019t work)\r\n<\/pre>\n<p>During the course of this user guide I have been purposely verbose with my comments; most comments are there to be informative or to explain sections of code that are less intuitive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comments allow software developers to document their code within the code itself. This is especially useful when modifying existing code written by other developers; to be able to read a brief description of what the code is trying to accomplish rather than waste time deciphering source code. There are two ways to define a comment [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":73,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python: Comments - Phantom Raspberry Blower<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.bulis.co.uk\/?page_id=188\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python: Comments - Phantom Raspberry Blower\" \/>\n<meta property=\"og:description\" content=\"Comments allow software developers to document their code within the code itself. This is especially useful when modifying existing code written by other developers; to be able to read a brief description of what the code is trying to accomplish rather than waste time deciphering source code. There are two ways to define a comment [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.bulis.co.uk\/?page_id=188\" \/>\n<meta property=\"og:site_name\" content=\"Phantom Raspberry Blower\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-20T11:32:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=188\",\"url\":\"http:\/\/www.bulis.co.uk\/?page_id=188\",\"name\":\"Python: Comments - Phantom Raspberry Blower\",\"isPartOf\":{\"@id\":\"http:\/\/www.bulis.co.uk\/#website\"},\"datePublished\":\"2017-07-20T01:41:29+00:00\",\"dateModified\":\"2017-07-20T11:32:13+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=188#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.bulis.co.uk\/?page_id=188\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=188#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.bulis.co.uk\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"http:\/\/www.bulis.co.uk\/?page_id=57\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Tutorials\",\"item\":\"http:\/\/www.bulis.co.uk\/?page_id=73\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Python: Comments\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.bulis.co.uk\/#website\",\"url\":\"http:\/\/www.bulis.co.uk\/\",\"name\":\"Phantom Raspberry Blower\",\"description\":\"Blowing Raspberrys since 1989\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.bulis.co.uk\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python: Comments - Phantom Raspberry Blower","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.bulis.co.uk\/?page_id=188","og_locale":"en_GB","og_type":"article","og_title":"Python: Comments - Phantom Raspberry Blower","og_description":"Comments allow software developers to document their code within the code itself. This is especially useful when modifying existing code written by other developers; to be able to read a brief description of what the code is trying to accomplish rather than waste time deciphering source code. There are two ways to define a comment [&hellip;]","og_url":"http:\/\/www.bulis.co.uk\/?page_id=188","og_site_name":"Phantom Raspberry Blower","article_modified_time":"2017-07-20T11:32:13+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.bulis.co.uk\/?page_id=188","url":"http:\/\/www.bulis.co.uk\/?page_id=188","name":"Python: Comments - Phantom Raspberry Blower","isPartOf":{"@id":"http:\/\/www.bulis.co.uk\/#website"},"datePublished":"2017-07-20T01:41:29+00:00","dateModified":"2017-07-20T11:32:13+00:00","breadcrumb":{"@id":"http:\/\/www.bulis.co.uk\/?page_id=188#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.bulis.co.uk\/?page_id=188"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.bulis.co.uk\/?page_id=188#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.bulis.co.uk\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"http:\/\/www.bulis.co.uk\/?page_id=57"},{"@type":"ListItem","position":3,"name":"Python Tutorials","item":"http:\/\/www.bulis.co.uk\/?page_id=73"},{"@type":"ListItem","position":4,"name":"Python: Comments"}]},{"@type":"WebSite","@id":"http:\/\/www.bulis.co.uk\/#website","url":"http:\/\/www.bulis.co.uk\/","name":"Phantom Raspberry Blower","description":"Blowing Raspberrys since 1989","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.bulis.co.uk\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/188"}],"collection":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=188"}],"version-history":[{"count":0,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/188\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/73"}],"wp:attachment":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}