{"id":5667,"date":"2022-07-17T13:11:48","date_gmt":"2022-07-17T13:11:48","guid":{"rendered":"https:\/\/computerscienced.co.uk\/site\/?page_id=5667"},"modified":"2022-07-17T13:12:49","modified_gmt":"2022-07-17T13:12:49","slug":"python-code-error-18-7-22","status":"publish","type":"page","link":"https:\/\/computerscienced.co.uk\/site\/python-coding-errors\/python-code-error-18-7-22\/","title":{"rendered":"Python code error 18\/7\/22"},"content":{"rendered":"\n<script>\nfunction myFunction() { var x = document.getElementById(\"myDIV\");\n  if (x.style.display === \"none\") {\n    x.style.display = \"block\";\n  } else {\n    x.style.display = \"none\";\n  }\n}\n<\/script>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:30% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"448\" src=\"https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2022\/01\/undraw_fixing_bugs_w7gi.svg\" alt=\"\" class=\"wp-image-4017 size-full\"\/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"has-normal-font-size\">Can you spot the Python coding error in this Heatwave alert themed code?  There is at least 1 error for you to find.  <\/p>\n\n\n\n<p class=\"has-normal-font-size\"><strong>Please note<\/strong> that this is an extract of code, with some values taken from the <a href=\"https:\/\/www.metoffice.gov.uk\/public\/weather\/heat-health\/?tab=heatHealth&amp;season=normal\">Met Office website<\/a>.  This code could be extended to include all regions, and include whether the temperature had hit these values (for a level 3 alert).      <\/p>\n\n\n\n<p><strong>Click where you think the errors are<\/strong>.  If you get it right an explanation will appear below the image.  <\/p>\n\n\n\n<p><strong>Indentation<\/strong><\/p>\n\n\n\n<p>If you think code should be indented more to the left, click to the left of the code, if you think code should be indented more to the right, click to the right of the code.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-pb-accordion-item c-accordion__item js-accordion-item no-js\" data-initially-open=\"false\" data-click-to-close=\"true\" data-auto-close=\"true\" data-scroll=\"false\" data-scroll-offset=\"0\"><h2 id=\"at-56670\" class=\"c-accordion__title js-accordion-controller\" role=\"button\"><i class=\"fas fa-info-circle\"><\/i> Help (Click to expand)<\/h2><div id=\"ac-56670\" class=\"c-accordion__content\">\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"epyt-video-wrapper\"><div  id=\"_ytid_64773\"  width=\"640\" height=\"360\"  data-origwidth=\"640\" data-origheight=\"360\"  data-relstop=\"1\" data-facadesrc=\"https:\/\/www.youtube.com\/embed\/6wuLwxu_jbo?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=0&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=0&#038;disablekb=0&#038;\" class=\"__youtube_prefs__ epyt-facade epyt-is-override  no-lazyload\"><img decoding=\"async\" data-spai-excluded=\"true\" class=\"epyt-facade-poster skip-lazy\" loading=\"lazy\"  alt=\"YouTube player\"  src=\"https:\/\/i.ytimg.com\/vi\/6wuLwxu_jbo\/maxresdefault.jpg\"  \/><button class=\"epyt-facade-play\" aria-label=\"Play\"><svg data-no-lazy=\"1\" height=\"100%\" version=\"1.1\" viewBox=\"0 0 68 48\" width=\"100%\"><path class=\"ytp-large-play-button-bg\" d=\"M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z\" fill=\"#f00\"><\/path><path d=\"M 45,24 27,14 27,34\" fill=\"#fff\"><\/path><\/svg><\/button><\/div><\/div>\n<\/div><\/figure>\n<\/div><\/div>\n\n\n\n\n<div class=\"h5p-content\" data-content-id=\"160\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Can you spot the Python coding error in this Heatwave alert themed code? There is at least 1 error for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4017,"parent":4016,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"disable_featured_image":true,"footnotes":""},"class_list":["post-5667","page","type-page","status-publish","has-post-thumbnail","hentry"],"blog_post_layout_featured_media_urls":{"thumbnail":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2022\/01\/undraw_fixing_bugs_w7gi.svg",150,150,true],"full":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2022\/01\/undraw_fixing_bugs_w7gi.svg",690,448,false]},"categories_names":null,"comments_number":"0","_links":{"self":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/comments?post=5667"}],"version-history":[{"count":2,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5667\/revisions"}],"predecessor-version":[{"id":5670,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5667\/revisions\/5670"}],"up":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/4016"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media\/4017"}],"wp:attachment":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media?parent=5667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}