{"id":109,"date":"2016-05-18T05:34:39","date_gmt":"2016-05-18T05:34:39","guid":{"rendered":"http:\/\/mr-west.uk\/gcsecomputerscience\/?page_id=109"},"modified":"2016-05-18T05:34:39","modified_gmt":"2016-05-18T05:34:39","slug":"the-3-levels-of-code","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/","title":{"rendered":"The 3 Levels of code"},"content":{"rendered":"\n<div class=\"arconix-tabs-horizontal\"><ul class=\"arconix-tabs\"><li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-MachineCode\"><a class=\"\" href=\"#tab-MachineCode\">Machine Code<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-AssemblyLanguage\"><a class=\"\" href=\"#tab-AssemblyLanguage\">Assembly Language<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-HighLevelLanguages\"><a class=\"\" href=\"#tab-HighLevelLanguages\">High Level Languages<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Translators\"><a class=\"\" href=\"#tab-Translators\">Translators<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-IDEs\"><a class=\"\" href=\"#tab-IDEs\">IDEs<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Challenges\"><a class=\"\" href=\"#tab-Challenges\">Challenges<\/a><\/li><\/ul>\n<div class=\"arconix-panes\"><div class=\"arconix-pane pane-MachineCode\">\n<div class=\"arconix-accordions arconix-accordions-vertical arconix-accordions-1\"><div class=\"arconix-accordion-title accordion-NativeBinary\"><i class=\"fa\"><\/i><p>Native Binary<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Computers operate in binary and can only process binary, so all instructions given to them must be in binary.<\/p>\n<p>A typical binary instruction might look like:<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python.png\" rel=\"attachment wp-att-114\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-114\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python.png\" alt=\"binary hello world python\" width=\"588\" height=\"334\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python.png 588w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python-300x170.png 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/a><\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Hexadecimal\"><i class=\"fa\"><\/i><p>Hexadecimal<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Unsurprisingly\u00a0human beings find this incredibly difficult to understand, so in order to read the binary system better, programmers use hexadecimal editors to view binary data.<\/p>\n<p>The above binary data looks like the following in hex:<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/hex-hello-world-python.png\" rel=\"attachment wp-att-115\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-115\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/hex-hello-world-python.png\" alt=\"hex hello world python\" width=\"391\" height=\"140\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/hex-hello-world-python.png 391w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/hex-hello-world-python-300x107.png 300w\" sizes=\"(max-width: 391px) 100vw, 391px\" \/><\/a><\/p>\n<p>This is slightly more readable for humans, but still not much use.<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Hexadecimalconverters\"><i class=\"fa\"><\/i><p>Hexadecimal converters<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>If we were to run the file through a hex to ascii convertor, we might get a little more information about what the file is, but not much!<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-hello-world-hex-and-text.png\" rel=\"attachment wp-att-116\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-116\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-hello-world-hex-and-text.png\" alt=\"python hello world hex and text\" width=\"622\" height=\"167\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-hello-world-hex-and-text.png 622w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-hello-world-hex-and-text-300x81.png 300w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/a><\/p>\n<p>We can start to see that there is a string &#8220;Hello World&#8221; and it lives in a helloworld.py file, but there no other readable information.<\/p>\n<p>Why?<\/p>\n<p>Because the rest of the information is a native instruction to the computer (written in a format that only that build of computer can process. The instruction in this instance, simply tells the computer to output &#8220;Hello World&#8221; to the standard output, which happens to be the monitor.<\/p>\n<\/div><\/div>\n<\/div>\n<div class=\"arconix-pane pane-AssemblyLanguage\">\n<p>Whilst computers can only process machine code, we need to be able to give instructions to a computer in a format that both:<\/p>\n<ul>\n<li>Humans can read<\/li>\n<li>The machine can process<\/li>\n<\/ul>\n<p>For this we use assembly language &#8211;\u00a0 halfway between machine code and human code.<\/p>\n<p>Every machine is built to a certain type of architecture (Celeron, Pentium, Core I-5, etc) and so every machine architecture has it&#8217;s own assembly language.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/pythonassemblylanguage.png\" rel=\"attachment wp-att-119\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-119\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/pythonassemblylanguage.png\" alt=\"pythonassemblylanguage\" width=\"668\" height=\"181\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/pythonassemblylanguage.png 668w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/pythonassemblylanguage-300x81.png 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<\/div>\n<div class=\"arconix-pane pane-HighLevelLanguages\">\n<div class=\"arconix-accordions arconix-accordions-vertical arconix-accordions-1\"><div class=\"arconix-accordion-title accordion-Whydoweneedhighlevellanguages\"><i class=\"fa\"><\/i><p>Why do we need high level languages?<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>You might now be thinking &#8220;Why don&#8217;t we all program in assembly language?&#8221;. It would save having to add another layer on top of assembly language, after all!<\/p>\n<p>The problem is that assembly language is specific to that particular architecture, which would mean that any program you write would only work on that specific type of machine!<\/p>\n<p>In order to get around this we have another layer on top &#8211; high level languages&#8217;. These languages are usually not architecture specific and so if you write a program it can be used on many different types of machine architecture.<\/p>\n<p>These are the programming languages that we as coders use!<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-high-level-language.png\" rel=\"attachment wp-att-120\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-120\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-high-level-language.png\" alt=\"python high level language\" width=\"338\" height=\"136\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-high-level-language.png 338w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/python-high-level-language-300x121.png 300w\" sizes=\"(max-width: 338px) 100vw, 338px\" \/><\/a><\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Abstraction\"><i class=\"fa\"><\/i><p>Abstraction<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>High level languages use a number of different abstractions. Examples of extractions include:<\/p>\n<ul>\n<li>Lists<\/li>\n<li>Functions<\/li>\n<li>Classes<\/li>\n<\/ul>\n<p>Abstractions allow humans to write code the resembles a normal human thought process and so improves:<\/p>\n<ul>\n<li>Coding speed<\/li>\n<li>Code reusibility<\/li>\n<li>Code readability<\/li>\n<\/ul>\n<\/div><div class=\"arconix-accordion-title accordion-PortabilityPlatformindependence\"><i class=\"fa\"><\/i><p>Portability \/ Platform independence<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Languages such as Python and Java can be used across multiple architectures and operating systems.<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Modularimplementation\"><i class=\"fa\"><\/i><p>Modular implementation<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>High level languages allow the coder to import \/ add modules, which improves coding speed and allows coders to use features that otherwise they would not be able to use.<\/p>\n<\/div><\/div>\n<\/div>\n<div class=\"arconix-pane pane-Translators\">\n<div class=\"arconix-accordions arconix-accordions-vertical arconix-accordions-1\"><div class=\"arconix-accordion-title accordion-Compilers\"><i class=\"fa\"><\/i><p>Compilers<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>As mentioned previously:<\/p>\n<ul>\n<li>Assembly languages are specific to a particular architecture.<\/li>\n<li>High level programming languages are designed to work on multiple architectures.<\/li>\n<\/ul>\n<p>Therefore if programs written in a high level language are to be executed on a computer, they must first be translated in to the assembly language specific to that computer. This is the job of the compiler.<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Assembler\"><i class=\"fa\"><\/i><p>Assembler<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Assemblers convert assembly language code in byte code ( binary)<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Interpreters\"><i class=\"fa\"><\/i><p>Interpreters<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Interpreters convert high level language to Byte code at run time.<\/p>\n<p>Advantages of interpreted languages<\/p>\n<p>Disadvantages of interpreted languages<\/p>\n<p>Less efficient at execution time, meaning less useful for :<\/p>\n<p>3D games<\/p>\n<p>Complex<\/p>\n<\/div><\/div>\n<\/div>\n<div class=\"arconix-pane pane-IDEs\">\n<div class=\"arconix-accordions arconix-accordions-vertical arconix-accordions-1\"><div class=\"arconix-accordion-title accordion-WhydoweneedIDEs\"><i class=\"fa\"><\/i><p>Why do we need IDEs?<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>When computers were first released, most programmers simple typed their code using simple text editors, such as notepad. These text editors can still be used to edit code, but editors designed specifically for coding have a number of useful features that help speed up and improve your code. These editors are known as IDEs.<\/p>\n<p>Click below to explore the key features of IDEs.<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Errorcheckinghighlightingtools\"><i class=\"fa\"><\/i><p>Error checking \/ highlighting tools<\/p><\/div><div class=\"arconix-accordion-content\">\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/error-highlighting.png\" rel=\"attachment wp-att-124\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-124\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/error-highlighting.png\" alt=\"error highlighting\" width=\"436\" height=\"78\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/error-highlighting.png 436w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/error-highlighting-300x54.png 300w\" sizes=\"(max-width: 436px) 100vw, 436px\" \/><\/a><\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Syntaxhighlighting\"><i class=\"fa\"><\/i><p>Syntax highlighting<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Syntax Highlighting changes the colour of components of code, depending on their function. This makes code more readable and makes it easier to spot errors in the code.<\/p>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-highlighting.png\" rel=\"attachment wp-att-125\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-125\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-highlighting.png\" alt=\"syntax highlighting\" width=\"457\" height=\"105\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-highlighting.png 457w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-highlighting-300x69.png 300w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><\/a><\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Run-timeenvironments\"><i class=\"fa\"><\/i><p>Run-time environments<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Run time environments allow the coder to run small sections of code line by line. This is extremely useful for:<\/p>\n<ul>\n<li>Trying out new modules and code you haven&#8217;t used before. You get to see the results of the code live.<\/li>\n<li>Debugging code &#8211; you can print out variables line by line to help find out where errors are happening. This is especially useful for finding logical errors.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/runtime-environment.png\" rel=\"attachment wp-att-126\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-126\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/runtime-environment.png\" alt=\"runtime environment\" width=\"851\" height=\"183\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/runtime-environment.png 851w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/runtime-environment-300x65.png 300w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/runtime-environment-768x165.png 768w\" sizes=\"(max-width: 851px) 100vw, 851px\" \/><\/a><\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Codesuggestionandauto-completion\"><i class=\"fa\"><\/i><p>Code suggestion and auto-completion<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Code suggestion is useful if you can&#8217;t remember exactly what a function is called. It also reduces coding errors when typing in variable names, as it displays variables that have been created.<\/p>\n<div id=\"attachment_134\" style=\"width: 442px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-suggestion-autocompletion1.png\" rel=\"attachment wp-att-134\"><img aria-describedby=\"caption-attachment-134\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-134 size-full\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-suggestion-autocompletion1.png\" alt=\"syntax suggestion autocompletion\" width=\"432\" height=\"156\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-suggestion-autocompletion1.png 432w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/syntax-suggestion-autocompletion1-300x108.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/a><p id=\"caption-attachment-134\" class=\"wp-caption-text\">Here I typed &#8216;co&#8217; and it brought up a number of different possibilities.<\/p><\/div>\n<p>&nbsp;<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Codetidying\"><i class=\"fa\"><\/i><p>Code tidying<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Code tidying is useful if you are updating or maintain large code files. It allows the coder to hide sections of code, making it easier to navigate around the file.<\/p>\n<div id=\"attachment_128\" style=\"width: 642px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingbefore.png\" rel=\"attachment wp-att-128\"><img aria-describedby=\"caption-attachment-128\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-128 size-full\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingbefore.png\" alt=\"codetidyingbefore\" width=\"632\" height=\"484\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingbefore.png 632w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingbefore-300x230.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a><p id=\"caption-attachment-128\" class=\"wp-caption-text\">Before : large code files become difficult to read and navigate<\/p><\/div>\n<div id=\"attachment_129\" style=\"width: 359px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingafter.png\" rel=\"attachment wp-att-129\"><img aria-describedby=\"caption-attachment-129\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-129 size-full\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingafter.png\" alt=\"codetidyingafter\" width=\"349\" height=\"91\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingafter.png 349w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/codetidyingafter-300x78.png 300w\" sizes=\"(max-width: 349px) 100vw, 349px\" \/><\/a><p id=\"caption-attachment-129\" class=\"wp-caption-text\">After: Functions that don&#8217;t need to be viewed can be hidden, making navigation much quicker<\/p><\/div>\n<\/div><div class=\"arconix-accordion-title accordion-Boilerplateauto-creation\"><i class=\"fa\"><\/i><p>Boiler plate auto-creation<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Some\u00a0languages and packages require a certain amount of repetitive code to be typed whenever a new file is created. IDEs can often create this boiler plate on behalf of the coder, speeding up development time and reducing errors.<\/p>\n<div id=\"attachment_130\" style=\"width: 544px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/boilerplate.png\" rel=\"attachment wp-att-130\"><img aria-describedby=\"caption-attachment-130\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-130 size-full\" src=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/boilerplate.png\" alt=\"boilerplate\" width=\"534\" height=\"283\" srcset=\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/boilerplate.png 534w, https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/boilerplate-300x159.png 300w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/><\/a><p id=\"caption-attachment-130\" class=\"wp-caption-text\">All the above code is auto-created when a new file is created, saving coding time.<\/p><\/div>\n<p>&nbsp;<\/p>\n<\/div><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"arconix-pane pane-Challenges\">\n<div class=\"arconix-accordions arconix-accordions-vertical arconix-accordions-1\"><div class=\"arconix-accordion-title accordion-Challenge1\"><i class=\"fa\"><\/i><p>Challenge 1<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Create a python file and create a function inside of the file that asks the user for their name and says &#8216;hello <em>name<\/em>&#8216; back to them. Save and run thee python file.<\/p>\n<p>What type of execution did python use &#8211; compiled or interpreted?<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Challenge2\"><i class=\"fa\"><\/i><p>Challenge 2<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>In the bash console compile your Python file using the following command:<\/p>\n<code><\/p>\n<p>python -m py_compile myfile.py<\/p>\n<p><\/code>\n<p>Have a look in the folder and see if you can see your file!<\/p>\n<code><\/p>\n<p>ls<\/p>\n<p><\/code>\n<p>Run your code in the interpreter using:<\/p>\n<code><\/p>\n<p>python3 myfile.pyc<\/p>\n<p><\/code>\n<p>What type of execution did python use this time &#8211; compiled or interpreted?<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Challenge3\"><i class=\"fa\"><\/i><p>Challenge 3<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Download the following hex editor:<\/p>\n<p><a href=\"https:\/\/mh-nexus.de\/en\/hxd\/\">https:\/\/mh-nexus.de\/en\/hxd\/<\/a><\/p>\n<p>Download your compiled file ( the pyc version) to your computer and open in it viewer.<\/p>\n<p>Locate the &#8211; Hexadecimal code, and the plain text. Can you recognise any bits?<\/p>\n<\/div><div class=\"arconix-accordion-title accordion-Challenge4\"><i class=\"fa\"><\/i><p>Challenge 4<\/p><\/div><div class=\"arconix-accordion-content\">\n<p>Open a bash console on PythonAnywhere in the same folder as your helloworld.pyc file.<\/p>\n<p>load up Python 3 using the python3 command.<\/p>\n<p>Decompile the helloworld.py file by using the following commands:<\/p>\n<code><\/p>\n<p>import dis, helloworld<\/p>\n<p>dis.dis(helloworld)<\/p>\n<p><\/code>\n<\/div><\/div>\n<\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":79,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"template_fullwidth.php","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The 3 Levels of code - GCSE Computer Science Theory<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The 3 Levels of code - GCSE Computer Science Theory\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/\" \/>\n<meta property=\"og:site_name\" content=\"GCSE Computer Science Theory\" \/>\n<meta property=\"og:image\" content=\"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python.png\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/\",\"name\":\"The 3 Levels of code - GCSE Computer Science Theory\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\"},\"datePublished\":\"2016-05-18T05:34:39+00:00\",\"dateModified\":\"2016-05-18T05:34:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OCR GCSE Computer Science Home\",\"item\":\"https:\/\/learnlearn.uk\/gcsecs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OCR Theory\",\"item\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Algorithms\",\"item\":\"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"The 3 Levels of code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"name\":\"GCSE Computer Science Theory\",\"description\":\"Just another My Blog site\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\",\"name\":\"GCSE Computer Science Theory\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"GCSE Computer Science Theory\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The 3 Levels of code - GCSE Computer Science Theory","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":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/","og_locale":"en_GB","og_type":"article","og_title":"The 3 Levels of code - GCSE Computer Science Theory","og_url":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/","og_site_name":"GCSE Computer Science Theory","og_image":[{"url":"http:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2016\/05\/binary-hello-world-python.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/","url":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/","name":"The 3 Levels of code - GCSE Computer Science Theory","isPartOf":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#website"},"datePublished":"2016-05-18T05:34:39+00:00","dateModified":"2016-05-18T05:34:39+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/the-3-levels-of-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"OCR GCSE Computer Science Home","item":"https:\/\/learnlearn.uk\/gcsecs\/"},{"@type":"ListItem","position":2,"name":"OCR Theory","item":"https:\/\/learnlearn.uk\/gcsecs\/theory\/"},{"@type":"ListItem","position":3,"name":"Algorithms","item":"https:\/\/learnlearn.uk\/gcsecs\/theory\/algorithms\/"},{"@type":"ListItem","position":4,"name":"The 3 Levels of code"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/gcsecs\/#website","url":"https:\/\/learnlearn.uk\/gcsecs\/","name":"GCSE Computer Science Theory","description":"Just another My Blog site","publisher":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization","name":"GCSE Computer Science Theory","url":"https:\/\/learnlearn.uk\/gcsecs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"GCSE Computer Science Theory"},"image":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/gcsecs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":null,"_links":{"self":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/109"}],"collection":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/109\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/79"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/media?parent=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}