{"id":750,"date":"2016-12-03T09:43:59","date_gmt":"2016-12-03T09:43:59","guid":{"rendered":"http:\/\/learnlearn.uk\/python\/?p=750"},"modified":"2016-12-03T14:51:23","modified_gmt":"2016-12-03T14:51:23","slug":"python-calorie-tracker-tutorial","status":"publish","type":"post","link":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/","title":{"rendered":"Python Calorie Tracker Tutorial"},"content":{"rendered":"\n<div class=\"arconix-tabs-horizontal\"><ul class=\"arconix-tabs\"><li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Planning\"><a class=\"\" href=\"#tab-Planning\">Planning<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-1-BasicFunctionality\"><a class=\"\" href=\"#tab-1-BasicFunctionality\">1 - Basic Functionality<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-2-InputValidation\"><a class=\"\" href=\"#tab-2-InputValidation\">2 - Input Validation<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-3-DisplayingValues\"><a class=\"\" href=\"#tab-3-DisplayingValues\">3 - Displaying Values<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-4-DataStorage\"><a class=\"\" href=\"#tab-4-DataStorage\">4 - Data Storage<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-FinalCode\"><a class=\"\" href=\"#tab-FinalCode\">Final Code<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Improvements\"><a class=\"\" href=\"#tab-Improvements\">Improvements<\/a><\/li><\/ul>\n<div class=\"arconix-panes\"><div class=\"arconix-pane pane-Planning\">\n<div class=\"arconix-column-two-thirds\">\n<h3>Python Calorie Tracker Tutorial<\/h3>\n<p>The aim of this lesson is practice some of the skills you have learnt so far, by making a calorie consumption tracker.<\/p>\n<p>For this program, unlike previous programs,\u00a0we are not going to do a lot of planning, because the program is going to evolve as we code it, so instead we are\u00a0going to develop my program through a series of <strong>versions<\/strong> &#8211; coding the program until it gets to a certain level, then using &#8216;save as&#8217; to move on to the next version.<\/p>\n<p><strong>Version\u00a01 &#8211; Basic functionality<\/strong><\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>Ask the user to input their calorie intake for a period of 7 days at a time.<\/li>\n<li>For each week display the total amount of calories consumed, the average and the days where most\/least were consumed.<\/li>\n<\/ul>\n<\/div>\n<p><strong>Version 2 &#8211; Input Validation &amp; Advice<\/strong><\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>If the users inputs invalid data, get them to input it again.<\/li>\n<li>If the user is eating too much or too little, give them a warning.<\/li>\n<\/ul>\n<\/div>\n<p><strong>Version 3 &#8211;\u00a0Data for 4 weeks<\/strong><\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>Display the calorie intake values for the last 4 weeks in total.<\/li>\n<\/ul>\n<\/div>\n<p><strong>Version 4 &#8211; \u00a0Persistent File Storage\u00a0<\/strong><\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>The data should be stored in a text file for persistent storage.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"arconix-column-one-third\">\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-760 size-medium\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640-300x200.jpg\" alt=\"Python Calorie Tracker Tutorial\" width=\"300\" height=\"200\" srcset=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640-300x200.jpg 300w, https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640-600x399.jpg 600w, https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<\/div>\n<\/div>\n<div class=\"arconix-pane pane-1-BasicFunctionality\">\n<h3>Version\u00a01 &#8211; Basic functionality<\/h3>\n<p>For this\u00a0we \u00a0can start out and write a simple program\u00a0the performs all the required functions for objective 1, and it could look a bit like this:<\/p>\n<p><strong><span style=\"color: #0000ff;\">Version 1a (inefficient version)<\/span><\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/2ed1d2585f0b7d9e03f23729c9c8b84b.js\"><\/script><\/p>\n<p>This program works, but it is really quite inefficient and so it needs to be changed! remember that for the programming projects at GCSE level, in order to get full marks your program needs to be efficient!<\/p>\n<p><strong><span style=\"color: #0000ff;\">Version 1b (efficient version)<\/span><\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/3afe7bb6cf809b6301c7f18bd9619ebd.js\"><\/script><\/p>\n<p>Here we have swapped the 7 inputs for 1 input and put all the values in to a list. This will help us later on when we come to display the values for each day.<\/p>\n<\/div>\n<div class=\"arconix-pane pane-2-InputValidation\">\n<h3>Version\u00a02 &#8211; Input validation and advice<\/h3>\n<p>Version one of the program is already looking good, but it at the moment it is not very robust. If you enter anything other than a number in to the program it breaks.<\/p>\n<p>If the user enters a ridiculous number ( such as -50 or 200000), it just happily accepts the number. To fix this, we need to use a function. This is will allow us to improve our program with the minimum amount of fuss and maximum benefit.<\/p>\n<p><strong><span style=\"color: #0000ff;\">The getCalories() function<\/span><\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/f2be34926dfcc83ffea11ebf61c44a7b.js\"><\/script><\/p>\n<p><strong><span style=\"color: #0000ff;\">Edited code in the main file.<\/span><\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/1d71144dee97a2a35638fb7825b0e1a0.js\"><\/script><\/p>\n<p><strong><span style=\"color: #0000ff;\">Final code version 2<\/span><\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/839cc1b34e03c67715f635deaf3fdfd3.js\"><\/script><\/p>\n<\/div>\n<div class=\"arconix-pane pane-3-DisplayingValues\">\n<h3>Version 3 &#8211; Display four weeks of values<\/h3>\n<p>Now we have got our program working for 1 week, we need to get it working for all 4 weeks. To keep our program nice and simple, we are going to ask the user which week&#8217;s values they want to enter, and then add that week&#8217;s values. All our data is going to be stored in a 2 dimensional list ( a list within a list) and then it is going to be displayed on the main screen.<\/p>\n<p><strong>Functions as screens (lines 16 &amp; 38)<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/5cbe6bf648eb55796d2fdfc54d3d964e.js\"><\/script><\/p>\n<p>Now that our program is going to be using more than one screen, it is a good idea to move our code in to functions for each screen. You can see this in action in the finished code below where our code is now split into 3 functions<\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>main() &#8211; This is the screen that displays the values stored in the whole month.<\/li>\n<li>getAWeek() &#8211; This is the screen that get&#8217;s the calorie values for a week.<\/li>\n<li>getCalories &#8211; This is a function that gets the individual values for a particular day.<\/li>\n<\/ul>\n<\/div>\n<p>You will also notice that the<strong> os.system(&#8220;clear&#8221;<\/strong>) function is used to clear the screen of text between each screen.<\/p>\n<p><strong>Print without newline<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/cd1ae11d93b9327bf63fa46ec1be408e.js\"><\/script><br \/>\n Sometimes we will want to use a print inside of a loop to print on one line. We can stop the computer adding a newline after each line iteration of the loop by adding <strong>end = &#8220;\\t&#8221;<\/strong> to each print statement. This way, instead of adding a newline, it just adds a tab &#8211; great for making tables!<\/p>\n<p><strong>Replacing list items<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/66b592e89af855ce52d69eef0ef63f19.js\"><\/script><\/p>\n<p>When we start our program, rather than create an empty list, we create a list that contains 4 empty lists. These empty lists are then later replaced with the lists of values as they are added.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/05e7d2d9ed29b6d9ab896105835fb16a.js\"><\/script><\/p>\n<\/div>\n<div class=\"arconix-pane pane-4-DataStorage\">\n<h3>Version 4 &#8211; Persistent Data Storage in a file<\/h3>\n<p>Our program is now working quite well, but there is a problem! Whenever we close our program, we lose all our data and have to start again&#8230; This is no good. What we need is a way to save our data that is stored in the month list. The quickiest and most &#8216;Pythonesque&#8217; way of doing this is to use <strong>pickle<\/strong>.<\/p>\n<p>Using pickle is quite easy and is broken down in to 2 steps.<\/p>\n<p><strong>Step 1 &#8211; Loading your\u00a0data from a pickle file<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/d0e914a3eebc23746ba314a2867e3a60.js\"><\/script><\/p>\n<p>To load our data from a pickle file is easy-peasy. We just need a couple of lines of code.<\/p>\n<p><strong>Step 2 &#8211; Saving your data<\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/richardbwest\/dd47d3351f8e3815ba5f7b186c8d804d.js\"><\/script><\/p>\n<p>Saving pickle files is even easier, just one line of code!<\/p>\n<\/div>\n<div class=\"arconix-pane pane-FinalCode\">\n<h3>Final Code<\/h3>\n<p>Here is the final code!<br \/>\n<script src=\"https:\/\/gist.github.com\/richardbwest\/11b93e737afca43f97f8dfaf650bc7c4.js\"><\/script><br \/>\n<\/div>\n<div class=\"arconix-pane pane-Improvements\">\n<h3>Improving the program<\/h3>\n<p>We now have a fully working program, but there are still a few improvements to make!<\/p>\n<div class=\"arconix-list\" data-arconix-icon=\"fa-chevron-circle-right\" data-arconix-color=\"black\">\n<ul>\n<li>On the main screen, when we are asked to input the input the week number we want to edit, the input is not validated (checked that it only contains 1,2,3 or 4). We can now write a function (similar to the getCalories() function) that only allows valid input.<\/li>\n<li>We could add the option to clear all data from the database.<\/li>\n<li>We could add an option to display the monthly average calories consume<\/li>\n<\/ul>\n<\/div>\n<\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","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":""},"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Calorie Tracker Tutorial - Python<\/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\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Calorie Tracker Tutorial - Python\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Python\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-03T09:43:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-12-03T14:51:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"426\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"learnlearnadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"learnlearnadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\"},\"author\":{\"name\":\"learnlearnadmin\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/37d61760b611e12d655e20de44b12f02\"},\"headline\":\"Python Calorie Tracker Tutorial\",\"datePublished\":\"2016-12-03T09:43:59+00:00\",\"dateModified\":\"2016-12-03T14:51:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\"},\"wordCount\":977,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#organization\"},\"articleSection\":[\"tutorials\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\",\"url\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\",\"name\":\"Python Calorie Tracker Tutorial - Python\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#website\"},\"datePublished\":\"2016-12-03T09:43:59+00:00\",\"dateModified\":\"2016-12-03T14:51:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Python Unit Home\",\"item\":\"https:\/\/learnlearn.uk\/python\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Calorie Tracker Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#website\",\"url\":\"https:\/\/learnlearn.uk\/python\/\",\"name\":\"Python\",\"description\":\"Programming\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/python\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#organization\",\"name\":\"Python\",\"url\":\"https:\/\/learnlearn.uk\/python\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"Python\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/37d61760b611e12d655e20de44b12f02\",\"name\":\"learnlearnadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/07a2ee7e04b8bee91a78709b019de541?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/07a2ee7e04b8bee91a78709b019de541?s=96&d=mm&r=g\",\"caption\":\"learnlearnadmin\"},\"url\":\"https:\/\/learnlearn.uk\/python\/author\/learnlearnadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Calorie Tracker Tutorial - Python","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\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/","og_locale":"en_GB","og_type":"article","og_title":"Python Calorie Tracker Tutorial - Python","og_url":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/","og_site_name":"Python","article_published_time":"2016-12-03T09:43:59+00:00","article_modified_time":"2016-12-03T14:51:23+00:00","og_image":[{"width":640,"height":426,"url":"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg","type":"image\/jpeg"}],"author":"learnlearnadmin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"learnlearnadmin","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#article","isPartOf":{"@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/"},"author":{"name":"learnlearnadmin","@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/37d61760b611e12d655e20de44b12f02"},"headline":"Python Calorie Tracker Tutorial","datePublished":"2016-12-03T09:43:59+00:00","dateModified":"2016-12-03T14:51:23+00:00","mainEntityOfPage":{"@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/"},"wordCount":977,"commentCount":0,"publisher":{"@id":"https:\/\/learnlearn.uk\/python\/#organization"},"articleSection":["tutorials"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/","url":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/","name":"Python Calorie Tracker Tutorial - Python","isPartOf":{"@id":"https:\/\/learnlearn.uk\/python\/#website"},"datePublished":"2016-12-03T09:43:59+00:00","dateModified":"2016-12-03T14:51:23+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/python\/2016\/12\/03\/python-calorie-tracker-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Python Unit Home","item":"https:\/\/learnlearn.uk\/python\/"},{"@type":"ListItem","position":2,"name":"Python Calorie Tracker Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/python\/#website","url":"https:\/\/learnlearn.uk\/python\/","name":"Python","description":"Programming","publisher":{"@id":"https:\/\/learnlearn.uk\/python\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/python\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/python\/#organization","name":"Python","url":"https:\/\/learnlearn.uk\/python\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"Python"},"image":{"@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/37d61760b611e12d655e20de44b12f02","name":"learnlearnadmin","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/07a2ee7e04b8bee91a78709b019de541?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/07a2ee7e04b8bee91a78709b019de541?s=96&d=mm&r=g","caption":"learnlearnadmin"},"url":"https:\/\/learnlearn.uk\/python\/author\/learnlearnadmin\/"}]}},"rttpg_featured_image_url":{"full":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"landscape":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"portraits":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"thumbnail":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640-150x150.jpg",150,150,true],"medium":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640-300x200.jpg",300,200,true],"large":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"1536x1536":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"2048x2048":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false],"neve-blog":["https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2016\/12\/appetite-1239056_640.jpg",640,426,false]},"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/python\/author\/learnlearnadmin\/"},"rttpg_comment":78,"rttpg_category":"<a href=\"https:\/\/learnlearn.uk\/python\/category\/tutorials\/\" rel=\"category tag\">tutorials<\/a>","rttpg_excerpt":null,"_links":{"self":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/posts\/750"}],"collection":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/comments?post=750"}],"version-history":[{"count":0,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/posts\/750\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/media\/760"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/media?parent=750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/categories?post=750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/tags?post=750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}