{"id":5692,"date":"2022-07-18T17:25:33","date_gmt":"2022-07-18T17:25:33","guid":{"rendered":"https:\/\/computerscienced.co.uk\/site\/?page_id=5692"},"modified":"2022-07-18T17:25:33","modified_gmt":"2022-07-18T17:25:33","slug":"ks3-puzzle-7-challenge-python-subroutines","status":"publish","type":"page","link":"https:\/\/computerscienced.co.uk\/site\/parsons-puzzles\/ks3-puzzle-7-challenge-python-subroutines\/","title":{"rendered":"KS3 Puzzle 7 Challenge Python &#8211; subroutines"},"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<p><strong>Code \/ algorithm aim<\/strong><\/p>\n\n\n\n<p>The program should setup the first question as a subroutine. The subroutine should ask the user what the capital city of France is. The program should check that the user enters Paris and if they do should tell the user they have the right answer and call the second question subroutine.<\/p>\n\n\n\n<p>If the user does not enter Paris the user should be told that they are incorrect and should try again. The first question subroutine should be called again to start the question again.<\/p>\n\n\n\n<p>The program should setup the second question as a subroutine. The subroutine should ask the user what the capital city of Germany is. The program should check that the user enters Berlin and if they do should tell the user they have the right answer.<\/p>\n\n\n\n<p>If the user does not enter Berlin the user should be told that they are incorrect and should try again. The second question subroutine should be called again to start the question again.<\/p>\n\n\n\n<p>Finally the quiz should be started by calling the first subroutine.<\/p>\n\n\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-56920\" class=\"c-accordion__title js-accordion-controller\" role=\"button\"> Instructions (click to view)<\/h2><div id=\"ac-56920\" class=\"c-accordion__content\">\n<p>All the code that you need has been given below.  Simply organise the code blocks into the correct order and indent where necessary (by dragging the code block to the right) so that the code follows the algorithm aim above.  <\/p>\n\n\n\n<p> <\/p>\n<\/div><\/div>\n\n\n<div class=\"h5p-iframe-wrapper\"><iframe id=\"h5p-iframe-164\" class=\"h5p-iframe\" data-content-id=\"164\" style=\"height:1px\" src=\"about:blank\" frameBorder=\"0\" scrolling=\"no\" title=\"KS3 Parson puzzle 7 Python indentation\"><\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Code \/ algorithm aim The program should setup the first question as a subroutine. The subroutine should ask the user&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2597,"parent":224,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"disable_featured_image":true,"footnotes":""},"class_list":["post-5692","page","type-page","status-publish","has-post-thumbnail","hentry"],"blog_post_layout_featured_media_urls":{"thumbnail":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_right_places_h9n3.svg",150,150,true],"full":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_right_places_h9n3.svg",1108,759,false]},"categories_names":null,"comments_number":"0","_links":{"self":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5692","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=5692"}],"version-history":[{"count":1,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5692\/revisions"}],"predecessor-version":[{"id":5693,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/5692\/revisions\/5693"}],"up":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media\/2597"}],"wp:attachment":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media?parent=5692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}