{"id":1411,"date":"2016-10-25T14:35:17","date_gmt":"2016-10-25T14:35:17","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=1411"},"modified":"2016-10-25T14:54:59","modified_gmt":"2016-10-25T14:54:59","slug":"n5-python-introduction","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2016\/10\/25\/n5-python-introduction\/","title":{"rendered":"N5 Python &#8211; Introduction"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers.png\"><img decoding=\"async\" data-attachment-id=\"1412\" data-permalink=\"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2016\/10\/25\/n5-python-introduction\/add2numbers\/\" data-orig-file=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers.png\" data-orig-size=\"897,613\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"add2numbers\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers-300x205.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEH8aCWV1LXdlc3Qt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yV6mWhgS2torXPH75OzXvQQ%2BnaeWUsw%2F53U0wY6sQH%2F3ICg4EgsnIUFrGssXClLVfSKtn1E5GJuh2B%2FcbJCrcRnWrjkeQELUiV0SmyPFZmwJbC9A%2BbSTnjr44iOZ%2BG76CTewMV9y0y7DcAhmb9pgsLlO%2B0%2FcukeJ1RkEGFM8OUrVqm4qRraz1cxVzTrZcLk0%2BRxISOqwYWnZD43ngR90zc5%2BPV2g7Pzr%2BQJX3FljzUAU%2FeXGj5FuoG8t1auLS6wu0WPOY%2B8GHR4WyKUZuYI70g%3D&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47U6OK6IA7P%2F20260806%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260806T232052Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=494f257a8bfd09fb52c4aa494b837fb141255e4b34e00826c4d7145ad536eab4\" data-large-file=\"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers.png\" class=\"size-medium wp-image-1412 alignright\" src=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers-300x205.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&#038;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEH8aCWV1LXdlc3QtMSJHMEUCIHQZZpdPrDlV2UA7ZQLoXLqJJhztw1H1BYhNP017oHjbAiEA3%2FC8vui%2FhVFWUgzDKVjMiOF567KPGFrhe%2Bf3%2FiKWW5gquAUISBAFGgwyNzM1NzAxOTU0MzMiDIyKOiMLWYetbGy5lSqVBTjl%2B0UJexc8MyLWXv5kNSTCgiR0RKHy8k1S6wzeaKBE3ggTaqsZTsPKQ2QfPxni4VKn%2BpcwRwWWci4QfhKgmitsjvY8Loq9J8HcFjPO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FuoG8t1auLS6wu0WPOY%2B8GHR4WyKUZuYI70g%3D&#038;X-Amz-Algorithm=AWS4-HMAC-SHA256&#038;X-Amz-Credential=ASIAT7MQN47U6OK6IA7P%2F20260806%2Feu-west-1%2Fs3%2Faws4_request&#038;X-Amz-Date=20260806T232052Z&#038;X-Amz-SignedHeaders=host&#038;X-Amz-Expires=900&#038;X-Amz-Signature=494f257a8bfd09fb52c4aa494b837fb141255e4b34e00826c4d7145ad536eab4\" alt=\"add2numbers\" width=\"300\" height=\"205\" srcset=\"https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers-300x205.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEH8aCWV1LXdlc3QtMSJHMEUCIHQZZpdPrDlV2UA7ZQLoXLqJJhztw1H1BYhNP017oHjbAiEA3%2FC8vui%2FhVFWUgzDKVjMiOF567KPGFrhe%2Bf3%2FiKWW5gquAUISBAFGgwyNzM1NzAxOTU0MzMiDIyKOiMLWYetbGy5lSqVBTjl%2B0UJexc8MyLWXv5kNSTCgiR0RKHy8k1S6wzeaKBE3ggTaqsZTsPKQ2QfPxni4VKn%2BpcwRwWWci4QfhKgmitsjvY8Loq9J8HcFjPOHcdaOUdOX%2B5teZh%2FVobvhO%2B1CgedquGLtMku54X09fzD7CC%2BWUMJ3l88HNMED%2BTYSBtMy5HXmxgWIKWijIiR0oBHRz8Epv%2BNufzN0BXNZGYcUgW5dRKA6tePPCJ5gzcqornUPru%2FaPN2tJLks%2Fjc9XBKInw8dJzL9%2FITdFNcJ%2BZeQqB8JKvfGugZJf3U5l27hxpPq6Z7kf5QUZzynWR6eUfhIIor%2FH15scNeACpi1JBqNi%2Fmum3zcgQ5Y1C7%2BMA3CZ%2ByDztgjMX%2B3i2XgrU%2Fp9YuA1Am%2BYbg%2BdkgrGMI4yPv5HsnjpHFiFH9M04gr7KxKy57fG8YRFIVAiIjYC%2BxcHpPiba6wqYcWC0NKbyIFdAvZxnHjOrhgylKfCineMyUx%2FCF00xET1r9noDLg5EFzULQDJxCL810cy71jMFzWlN5M2CRtlN7IEqgVtRRL3Nhv8B9qcwCAIi7iOSH9XKiTieQyQzs%2BGzddR8E8%2FQ%2FV4IoGVLDJeQQZmCmaKYiHea3RCL9w3k4e1C5Ni%2Bsj7vtYdTGVOhOh9%2F1W0vdX%2BXH2ESor1SJ8UuXWUF6TAyKoWi5X4sb2FEmHiioVQ86C9xCWz7H29pk9xcjfWUx5Bc9zOzpdnoltH1Zg4sPL91b7EaUo04hTdXhXH90xOZcBBWN336l4pgqzVrIv7YUr%2B54KB82BBChas%2BnB8Zq%2F10ZX8LxVYfbsrrb3sOIjUnkeGWx%2BGnkDGr8ob8q97FvPJkUuIhD6yV6mWhgS2torXPH75OzXvQQ%2BnaeWUsw%2F53U0wY6sQH%2F3ICg4EgsnIUFrGssXClLVfSKtn1E5GJuh2B%2FcbJCrcRnWrjkeQELUiV0SmyPFZmwJbC9A%2BbSTnjr44iOZ%2BG76CTewMV9y0y7DcAhmb9pgsLlO%2B0%2FcukeJ1RkEGFM8OUrVqm4qRraz1cxVzTrZcLk0%2BRxISOqwYWnZD43ngR90zc5%2BPV2g7Pzr%2BQJX3FljzUAU%2FeXGj5FuoG8t1auLS6wu0WPOY%2B8GHR4WyKUZuYI70g%3D&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47U6OK6IA7P%2F20260806%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260806T232052Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=494f257a8bfd09fb52c4aa494b837fb141255e4b34e00826c4d7145ad536eab4 300w, https:\/\/glow-prod-nl.s3.eu-west-1.amazonaws.com\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers-150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Iv7YUr%2B54KB82BBChas%2BnB8Zq%2F10ZX8LxVYfbsrrb3sOIjUnkeGWx%2BGnkDGr8ob8q97FvPJkUuIhD6yV6mWhgS2torXPH75OzXvQQ%2BnaeWUsw%2F53U0wY6sQH%2F3ICg4EgsnIUFrGssXClLVfSKtn1E5GJuh2B%2FcbJCrcRnWrjkeQELUiV0SmyPFZmwJbC9A%2BbSTnjr44iOZ%2BG76CTewMV9y0y7DcAhmb9pgsLlO%2B0%2FcukeJ1RkEGFM8OUrVqm4qRraz1cxVzTrZcLk0%2BRxISOqwYWnZD43ngR90zc5%2BPV2g7Pzr%2BQJX3FljzUAU%2FeXGj5FuoG8t1auLS6wu0WPOY%2B8GHR4WyKUZuYI70g%3D&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAT7MQN47U6OK6IA7P%2F20260806%2Feu-west-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20260806T232052Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=900&amp;X-Amz-Signature=b510683cc9031568d1fa37bdbeb1773b6c1a0699174f784f70b07cf9e9e863c2 150w, https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/10\/add2numbers.png 897w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>Our 1st Python program makes use of a number of new constructs and variables.<\/p>\n<p><strong>#<\/strong> &#8211; Internal Commentary, anything after the # on the same line is ignored by the translator<\/p>\n<p><strong>=<\/strong> (Assignment) &#8211; values are assigned to the variables using an equals sign.<\/p>\n<p><strong>input()<\/strong> &#8211; \u00a0a string is captured from the keyboard using the input() <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html\">function<\/a><\/p>\n<p><strong>int()<\/strong> &#8211; this function changes the datatype of the given variable to an integer (Whole number)<\/p>\n<p><strong>Expression<\/strong> &#8211; The expression is the right hand side of the =, this is evaluated and any calculations performed, the results are then assigned to the variable on the left hand side of the equals<\/p>\n<p><strong>print()<\/strong> &#8211; This <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html\">function<\/a> displays a string. The &#8220;,&#8221; is used to concatenate strings and add a space between them.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our 1st Python program makes use of a number of new constructs and variables. # &#8211; Internal Commentary, anything after the # on the same line is ignored by the translator = (Assignment) &#8211; values are assigned to the variables using an equals sign. input() &#8211; \u00a0a string is captured from the keyboard using the &hellip;<\/p>\n","protected":false},"author":32,"featured_media":1385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17932,17013],"tags":[432044,9849,21482,125716,125715],"class_list":["post-1411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computational-constructs","category-national-5","tag-432044","tag-input","tag-int","tag-print","tag-python"],"jetpack_featured_media_url":"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/09\/Slide3.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=1411"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"predecessor-version":[{"id":1416,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1411\/revisions\/1416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media\/1385"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}