{"id":600,"date":"2020-08-24T18:54:53","date_gmt":"2020-08-24T23:54:53","guid":{"rendered":"https:\/\/www.brezeale.com\/?p=600"},"modified":"2020-11-13T12:22:53","modified_gmt":"2020-11-13T18:22:53","slug":"python-crash-course","status":"publish","type":"post","link":"https:\/\/www.brezeale.com\/?p=600","title":{"rendered":"A Python Crash Course"},"content":{"rendered":"\n<p>This is a short introduction to python that assumes you are already familiar with another programming language, in particular something that uses a C-like syntax.  If you find this is too brief or just want more details, then you might be interested in my post <a rel=\"noreferrer noopener\" href=\"https:\/\/www.brezeale.com\/?p=286\" target=\"_blank\">Python Programming: A Self-Learning Guide<\/a>.<\/p>\n\n\n\n<p>Python is a high-level, object-oriented, interpreted language. We can process python code by either typing commands directly into the interpreter or by using the interpreter to process a file of commands (what I would call an actual program). &nbsp;Most python tutorials and books will demonstrate python commands by typing them into the interpreter; you will recognize this by the <code>&gt;&gt;&gt;<\/code> prompt.  Much of what I show will be programs that you can copy and then run yourself with the Python interpreter.<\/p>\n\n\n\n<p>Let&#8217;s start with some obvious differences between Python and C (or its descendents, like C++ or Java).<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Python requires that indentation be used for the bodies of functions, conditionals, and loops.  In those languages with a C-like syntax, this would be done via curly brackets.  This forces the indentation to match the logic.<\/li><li>While Python does have object types, you don&#8217;t need to declare variable types nor declare variables before their use.<\/li><li>Variable names can be re-used with the same or different types; a new object is created.<\/li><li>Strings and Booleans are built-in types in Python.  The print() function automatically adds a newline.  If you don&#8217;t want this behavior, then you must suppress it.<\/li><li>In Python versions beginning with 3.0, dividing an integer by an integer using a single slash produces a floating-point value.  To get an integer result from dividing an integer by an integer you should use two slashes.  In C the integer is produced by truncating any part to the right of the decimal value.  In Python the result is rounded down to the nearest integer.<\/li><\/ul>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Statements<\/h3>\n\n\n\n<p>Single line comments begin with <code>#<\/code>.  Multiline comments are wrapped in sets of three single quotes or three double quotes.<\/p>\n\n\n\n<p>C-style format specifiers can be use, although there are newer ways that don&#8217;t require that you know the type.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&quot;&quot;&quot;\n    the type() function allows us to see what type\n    Python thinks an object is\n\n    this is particularly helpful when debugging since\n    a variable name can be re-used with a new object\n    of a different type\n&quot;&quot;&quot;\n\na = 14\nprint( type(a) )  \nprint(&quot;a = %d&quot; % a)\nprint()   # print a blank line\n\nb = 37\nprint( type(b) )\nprint(&quot;b = %d&quot; % b, end=&quot;&quot;)  # suppress the newline\nprint(&quot;\\n&quot;)                  # print two newlines\n\nc = b\/a\nprint( type(c) )\nprint( c )\nprint(&quot;%d\/%d = %.3f&quot; % (b, a, c) )   # C-style\nprint(&quot;{}\/{} = {:.3f}&quot;.format(b, a, c))  # one of the new ways\nprint()   \n\nc = b\/\/a\nprint( type(c) )\nprint(&quot;{}\/\/{} = {}&quot;.format(b, a, c))\n\nprint()\nd, e = 99, 123\nprint(&quot;d = %d, e = %d&quot; % (d, e))\n\nd, e = e, d\nprint(&quot;d = %d, e = %d&quot; % (d, e))\n\n&quot;&quot;&quot;  output\n&lt;class &#039;int&#039;&gt;\na = 14\n\n&lt;class &#039;int&#039;&gt;\nb = 37\n\n&lt;class &#039;float&#039;&gt;\n2.642857142857143\n37\/14 = 2.643\n37\/14 = 2.643\n\n&lt;class &#039;int&#039;&gt;\n37\/\/14 = 2\n\nd = 99, e = 123\nd = 123, e = 99\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Booleans and Logical Operators<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\na = True\nprint( type(a) )\nprint(a)\n\nb = False\nprint( type(b) )\nprint(b)\n\nprint()\nprint(not a)\n\nprint()\nprint(a and a)  # only True and True is True\nprint(a and b)\nprint(b and b)\n\nprint()\nprint(a or a)   # only need one True among the or&#039;d values\nprint(a or b)\nprint(b or b)\n\n&quot;&quot;&quot;  output\n&lt;class &#039;bool&#039;&gt;\nTrue\n&lt;class &#039;bool&#039;&gt;\nFalse\n\nFalse\n\nTrue\nFalse\nFalse\n\nTrue\nTrue\nFalse\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Conditionals<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\na = 5\nb = 6\n\nif a==5 :\n    print(&quot;this is true\\n&quot;)\n\nif a == 100 or b &gt;= 99 :\n    print(&quot;at least one condition is true\\n&quot;)\nelse :\n    print(&quot;neither condition is true\\n&quot;)\n\n\nif a == 1 :\n    print(&quot;one\\n&quot;)\nelif a == 3 :   # only get here if previous condition false\n    print(&quot;three\\n&quot;)\nelif a == 5 :   # only get here if previous conditions false\n    print(&quot;five\\n&quot;)\nelse :          # only get here if previous conditions false\n    print(&quot;something else\\n&quot;)\n\nif a == 5 :\n    print(&quot;a is 5&quot;, end=&quot;&quot;)\n\n    if b == 6 :  # only get here is a is 5\n        print(&quot; and b is 6&quot;)\n\n&quot;&quot;&quot;  output\nthis is true\n\nneither condition is true\n\nfive\n\na is 5 and b is 6\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Loops<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ni = 0\n\nwhile i &lt; 5 :\n    if i%2 == 0 :\n        print(&quot;%d is even&quot; % i)\n    else :\n        print(&quot;%d is odd&quot; % i)\n\n    i += 1\n\nprint()\n\n# the for loop in Python iterates through\n#   a set of objects\n# it&#039;s similar to foreach in some languages\nfor i in range(0, 10, 3) :\n    print(&quot;i is {}&quot;.format(i) )\n\n&quot;&quot;&quot;  output\n0 is even\n1 is odd\n2 is even\n3 is odd\n4 is even\n\ni is 0\ni is 3\ni is 6\ni is 9\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Functions<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef f(a, b, c=5) :\n    # if c is not passed in, use c = 5\n\n    val1 = 2*a + b - c\n    val2 = 3*a + b**2 + c  # b**2 is b squared\n\n    return val1, val2\n\n#### program starts here\nx = 4\ny = -2\nz = 1\n\nv1, v2 = f(x, y)\nprint(&quot;v1 = {}, v2 = {}&quot;.format(v1, v2))\n\nv1, v2 = f(x, y, z)\nprint(&quot;v1 = {}, v2 = {}&quot;.format(v1, v2))\n\n\n&quot;&quot;&quot;  output\nv1 = 1, v2 = 21\nv1 = 5, v2 = 17\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Lists and Tuples<\/h3>\n\n\n\n<p>Lists in Python are similar to what you would call an array in C-style languages.  There are some notable differences, however:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>while indexing begins with 0 for the first element and counts up from there, we can also apply indexing to the end.  That is, the last element has index -1, the next to last element has index -2, and so forth.<\/li><li>Python lists can contain multiple types, for example, we could have an int followed by a string followed by another list.<\/li><li>we can add and remove elements from the list, with all of the memory management handled for us.<\/li><\/ul>\n\n\n\n<p><strong>sample program #1<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# a list is created with square brackets\nd = &#x5B;1, 2.345, &quot;cat&quot;, &#x5B;7, 8]]\n\n# iterate through elements of list\nfor x in d :\n    print(&quot;{} has type {}&quot;.format(x, type(x)))\n\nprint()\n\n\nsize = len(d)  # get number of elements in list\n\nd&#x5B;0] = 99  # change the first value\n\ni = 0\nwhile i &lt; size :\n    print(d&#x5B;i])\n    i = i + 1\n\nprint( d&#x5B;3]&#x5B;0] )\nprint( d&#x5B;3]&#x5B;1] )\nprint()\n\nprint( d&#x5B;-1] )\nprint( d&#x5B;-2] )\n\n# a tuple is created with parenthesis\nt = (12.34, &quot;cat&quot;)\n\nprint( t&#x5B;0] )\n\n&quot;&quot;&quot; tuples are immutable, so this would cause an error\nt&#x5B;0] = 66\n&quot;&quot;&quot;\n\n&quot;&quot;&quot;  output\n1 has type &lt;class &#039;int&#039;&gt;\n2.345 has type &lt;class &#039;float&#039;&gt;\ncat has type &lt;class &#039;str&#039;&gt;\n&#x5B;7, 8] has type &lt;class &#039;list&#039;&gt;\n\n99\n2.345\ncat\n&#x5B;7, 8]\n7\n8\n\n&#x5B;7, 8]\ncat\n12.34\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<p><strong>sample program #2<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# we can slice a list, producing a new list\na = &#x5B;3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\nprint(&quot;a = {}&quot;.format(a))\n\n# start slice at index 1, while less\n# than index 6, with step sizes of 2\nb = a&#x5B;1 : 6 : 2]\nprint(&quot;b = {}&quot;.format(b))\n\n&quot;&quot;&quot;\nwhat if we want to copy an entire list?\n\nwriting\n  c = a\nis legal, but c will be an alias for the\nsame list that a names\n&quot;&quot;&quot;\nc = a.copy()  # one of several ways to copy\nprint(&quot;c = {}&quot;.format(c))\n\n&quot;&quot;&quot;  output\na = &#x5B;3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\nb = &#x5B;4, 6, 8]\nc = &#x5B;3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<p><strong>sample program #3<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&quot;&quot;&quot;\n  lists are objects and have many associated methods\n&quot;&quot;&quot;\nx = &#x5B;1, 2, 3]\nprint(&quot;1: x = {}&quot;.format(x))\nx.append(99)      # add to end\nprint(&quot;2: x = {}&quot;.format(x))\nx.insert(1, 456)  # insert at index 1\nprint(&quot;3: x = {}&quot;.format(x))\nx.pop()           # remove from end\nprint(&quot;4: x = {}&quot;.format(x))\nx.pop(2)          # remove at index 2\nprint(&quot;5: x = {}&quot;.format(x))\nx.sort()\nprint(&quot;6: x = {}&quot;.format(x))\nx.reverse()\nprint(&quot;7: x = {}&quot;.format(x))\nprint()\n\nprint(3 in x)   # check if 3 in list\nprint(75 in x)  # check if 75 in list\n\n&quot;&quot;&quot;  output\n1: x = &#x5B;1, 2, 3]\n2: x = &#x5B;1, 2, 3, 99]\n3: x = &#x5B;1, 456, 2, 3, 99]\n4: x = &#x5B;1, 456, 2, 3]\n5: x = &#x5B;1, 456, 3]\n6: x = &#x5B;1, 3, 456]\n7: x = &#x5B;456, 3, 1]\n\nTrue\nFalse\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<p><strong>sample program #4<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&quot;&quot;&quot;\nwhat if we want to use one list as a\nstarting point for making another list?\n\nPython supports list comprehensions\n&quot;&quot;&quot;\n# loop version\nd = &#x5B;]\nfor i in a :\n    if i%2 == 1 :\n        d.append(i)\nprint(&quot;d = {}&quot;.format(d))\n\n# list comprehension version\nd = &#x5B;i for i in a if i%2 == 1]  \nprint(&quot;d = {}&quot;.format(d))\n\n&quot;&quot;&quot;\nd = &#x5B;3, 5, 7, 9, 11]\nd = &#x5B;3, 5, 7, 9, 11]\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Strings<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# strings are enclosed by single or double quotes\na = &#039;single quotes&#039;\nb = &quot;double quotes&quot;\nc = &quot;it&#039;s a mixture of quotes&quot;\n\nprint(&quot;a = %s&quot; % a)\nprint(&quot;b = %s&quot; % b)\nprint(&quot;c = %s&quot; % c)\n\nd = &quot;&quot;&quot;this string begins on this line\n       but extends to this line&quot;&quot;&quot;\nprint(&quot;d = %s&quot; % d)\n\n&quot;&quot;&quot; output\na = single quotes\nb = double quotes\nc = it&#039;s a mixture of quotes\nd = this string begins on this line\n       but extends to this line\n&quot;&quot;&quot;\n\n\n# we can use relational operators with strings\na = &quot;cat&quot;\nb = &quot;car&quot;\n\nif a &gt; b :\n    print(&quot;{} comes after {}&quot;.format(a, b))\nelif a &lt; b :\n    print(&quot;{} comes before {}&quot;.format(a, b))\nelse :\n    print(&quot;{} and {} have equal values&quot;.format(a, b))\n\n# prints &quot;cat comes after car&quot;\n\n\n# we can concatenate strings using +\ns = &quot;this&quot;\ns = s + &quot;string&quot;\ns = s + &quot;is&quot; + &quot;getting&quot; + &quot;longer&quot;\nprint(s)  # prints &quot;thisstringisgettinglonger&quot;\n\n\na = &quot;bookend&quot;\nb = a&#x5B; :4]  # when slicing lists or strings, if going all\nc = a&#x5B;4: ]  #   the way to an end can leave out that index\n\nprint(&quot;a {} without the {} is just a {}&quot;.format(a, c, b))\n# prints &quot;a bookend without the end is just a book&quot;\n\n\n# there are many string methods\na = &quot;123,abc,XYZ&quot;\nb = a.lower()\nc = a.upper()\nd = a.split(&#039;,&#039;)           # tokenize with comma as delimiter\nprint(&quot;a = {}&quot;.format(a))  \nprint(&quot;b = {}&quot;.format(b))  \nprint(&quot;c = {}&quot;.format(c))  \nprint(&quot;d = {}&quot;.format(d))  # a list of tokens\n\n&quot;&quot;&quot; output\na = 123,abc,XYZ\nb = 123,abc,xyz\nc = 123,ABC,XYZ\nd = &#x5B;&#039;123&#039;, &#039;abc&#039;, &#039;XYZ&#039;]\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">File Input\/Output<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&quot;&quot;&quot; code below reads  sample.txt\none\ntwo\nthree\n&quot;&quot;&quot;\n\nfp = open(&quot;sample.txt&quot;, &quot;r&quot;)\n\nfor line in fp :\n    print(line)   #  print lines from file\n\nfp.close()\n\n&quot;&quot;&quot;  output\n# each line ends in a newline and print() also adds a newline\none\n\ntwo\n\nthree\n&quot;&quot;&quot;\n\n\nfp = open(&quot;sample.txt&quot;, &quot;r&quot;)\ndata = fp.readlines()  # store lines from file in a list as strings\nfp.close()\n\nfp = open(&quot;output.txt&quot;, &quot;w&quot;)\nfor line in data :\n    fp.write(&quot;out: %s&quot; % line)\nfp.close()\n\n&quot;&quot;&quot;  output.txt\nout: one\nout: two\nout: three\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Dictionaries<\/h3>\n\n\n\n<p>A dictionary is a built-in data structure in Python that stores information using key\/value pairs.  They are hash tables, so finding values by key is quick.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#  dictionaries are created using curly braces\n#  the syntax is key : value\n#  keys must be unique and immutable\nd = {&quot;cat&quot; : &quot;Felix&quot;,\n     123 : &quot;dog&quot;,\n     &quot;aList&quot; : &#x5B;1, 2, 3]}\n\nprint(d)\nprint(d&#x5B;123])\nprint(d&#x5B;&quot;aList&quot;])\n\n&quot;&quot;&quot; output\n{&#039;cat&#039;: &#039;Felix&#039;, 123: &#039;dog&#039;, &#039;aList&#039;: &#x5B;1, 2, 3]}\ndog\n&#x5B;1, 2, 3]\n&quot;&quot;&quot;\n\n\nd&#x5B;&quot;aList&quot;].append(4)\nd&#x5B;&quot;aList&quot;].append(5)\nd&#x5B;&quot;aList&quot;].append(6)\nd&#x5B;&quot;newKey&quot;] = &quot;newValue&quot;   # add key\/value pair\nd&#x5B;123] = &quot;elephant&quot;        # change value\ndel d&#x5B;&quot;cat&quot;]               # delete key\/value pair\nprint(d)\n\n&quot;&quot;&quot; output\n{123: &#039;elephant&#039;, &#039;aList&#039;: &#x5B;1, 2, 3, 4, 5, 6], &#039;newKey&#039;: &#039;newValue&#039;}\n&quot;&quot;&quot;\n\n\nprint(&quot;the keys are {}&quot;.format(d.keys()))\nprint(&quot;the values are {}&quot;.format(d.values()))\n\n&quot;&quot;&quot; output\nthe keys are dict_keys(&#x5B;123, &#039;aList&#039;, &#039;newKey&#039;])\nthe values are dict_values(&#x5B;&#039;elephant&#039;, &#x5B;1, 2, 3, 4, 5, 6], &#039;newValue&#039;])\n&quot;&quot;&quot;\n\n\nfor k in d :\n    print(&quot;key: {}, value: {}&quot;.format(k, d&#x5B;k]))\n\n&quot;&quot;&quot; output\nkey: 123, value: elephant\nkey: aList, value: &#x5B;1, 2, 3, 4, 5, 6]\nkey: newKey, value: newValue\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Modules (aka, libraries)<\/h3>\n\n\n\n<p>One of the reasons that Python is so popular is that there are a huge number of libraries (modules in Python terminology) available, many of which come with the standard Python installation.  Here is a sample of some libraries I have found useful.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport math\n\nprint(&quot;e^1 = {}&quot;.format(math.exp(1)) )\nprint(&quot;log base 2 of {} is {}&quot;.format(2048, math.log2(2048)) )\nprint(&quot;sqrt(2) = {}&quot;.format(math.sqrt(2)) )\nprint(&quot;sin(pi\/4) = {}&quot;.format(math.sin(math.pi\/4)) )\n\n&quot;&quot;&quot;  output\ne^1 = 2.718281828459045\nlog base 2 of 2048 is 11.0\nsqrt(2) = 1.4142135623730951\nsin(pi\/4) = 0.7071067811865475\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<br>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport csv\n\nfp = open(&quot;csvFile.csv&quot;, &quot;r&quot;)\nreader = csv.reader(fp)\n    \nfor line in reader :\n    print(line)   # each line is a list of tokens\n    \nfp.close()\n\n&quot;&quot;&quot;  csvFile.csv\n1,2,3\n4,5,6,7\n\n     program prints\n&#x5B;&#039;1&#039;, &#039;2&#039;, &#039;3&#039;]\n&#x5B;&#039;4&#039;, &#039;5&#039;, &#039;6&#039;, &#039;7&#039;]\n&quot;&quot;&quot;\n\n<\/pre><\/div>\n\n\n<br>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport datetime\n\ntoday = datetime.date.today()\nfuture = datetime.timedelta(days=14)\nfutureString = &quot;%s&quot; % (today + future)\nf = datetime.datetime.strptime(futureString, &#039;%Y-%m-%d&#039;)\nfuture = f.strftime(&#039;%m\/%d\/%Y&#039;)\n\nd = today.strftime(&quot;%m\/%d\/%y&quot;)\nprint(&quot;today is {} or {}&quot;.format(today,d) )\nprint(&quot;in 14 days it will be {}&quot;.format(future) )\n\n&quot;&quot;&quot;  output\ntoday is 2020-08-24 or 08\/24\/20\nin 14 days it will be 09\/07\/2020\n&quot;&quot;&quot;\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a short introduction to python that assumes you are already familiar with another programming language, in particular something that uses a C-like syntax. If you find this is too brief or just want more details, then you might be interested in my post Python Programming: A Self-Learning Guide. Python is a high-level, object-oriented, interpreted language. We can process python code by either typing commands directly into the interpreter or by using the interpreter to process a file of&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.brezeale.com\/?p=600\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9,5],"tags":[],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-programming","category-python-programming"],"_links":{"self":[{"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=600"}],"version-history":[{"count":10,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":691,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=\/wp\/v2\/posts\/600\/revisions\/691"}],"wp:attachment":[{"href":"https:\/\/www.brezeale.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brezeale.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}