{"id":42064,"date":"2021-08-14T20:42:33","date_gmt":"2021-08-14T20:42:33","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=42064"},"modified":"2021-08-14T20:42:35","modified_gmt":"2021-08-14T20:42:35","slug":"python-triple-quotes","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/python-triple-quotes\/","title":{"rendered":"Python: triple quotes"},"content":{"rendered":"\n<h2>Self-tutoring about programming: the tutor mentions triple quotes in Python.<\/h2>\n<p>Technically, there&#8217;s no way (that I know of) to produce multiline comments in Python. Rather, the suggestion is that each line is preceded with #.\n<p>Yet, in Python, triple quotes can be used to wrap long strings. In my experience, setting a long string, but not using it, can be used to store information in the program. While not technically a comment, it perhaps achieves the same effect.<\/p>\n<p>People have various opinions about this, and it&#8217;s probably unsafe to put special characters and such in the triple quotes. However, for just word characters that might be used to remind oneself of an idea, it seems a practical hack for experimental code.<\/p>\n<div style=\"color:green\">\n<p>x=&#8221;&#8221;&#8221;<\/p>\n<p>Hello!<\/p>\n<p>I need to remember this!<\/p>\n<p>&#8220;&#8221;&#8221;<\/p>\n<\/div>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/www.geeksforgeeks.org\/triple-quotes-in-python\/\">geeksforgeeks.org<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/7696924\/is-there-a-way-to-create-multiline-comments-in-python\">stackoverflow.com<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about programming: the tutor mentions triple quotes in Python. Technically, there&#8217;s no way (that I know of) to produce multiline comments in Python. Rather, the suggestion is that each line is preceded with #. Yet, in Python, triple quotes &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/python-triple-quotes\/\"> <span class=\"screen-reader-text\">Python: triple quotes<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1856],"tags":[],"class_list":["post-42064","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=42064"}],"version-history":[{"count":8,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42064\/revisions"}],"predecessor-version":[{"id":42072,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42064\/revisions\/42072"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=42064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=42064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=42064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}