{"id":1060,"date":"2023-02-13T01:24:01","date_gmt":"2023-02-13T01:24:01","guid":{"rendered":"https:\/\/www.goodacademic.com\/blog\/questions\/python-homework-help\/"},"modified":"2023-02-13T01:24:01","modified_gmt":"2023-02-13T01:24:01","slug":"python-homework-help","status":"publish","type":"questions","link":"https:\/\/www.goodacademic.com\/blog\/questions\/python-homework-help\/","title":{"rendered":"Python Homework Help"},"content":{"rendered":"<p>Reviewing other developer\u2019s work is essential. Reviewing the work of others makes both the reviewer and the reviewee better developers by allowing you to see how others might solve the same problem. It also ensures that standards are adhered to and offer the potential to catch logic errors that would otherwise end up in production.&nbsp; Peer code reviews are typically done by a pull request.&nbsp; The following video will outline how this is done and provide some helpful advice on completing your homework for this week.&nbsp; Please make sure you are following the steps outlined in this video.<\/p>\n<p>https:\/\/bellevue.mediaspace.kaltura.com\/media\/Code+Review+and+Pull+Request\/1_uegwl6fu<\/p>\n<p># This is a header for the application<br \/>\n# You should read this header and insert your name and your date below as part of the peer review<br \/>\n# This is a typical part of any program<br \/>\n# Author: &lt;author&gt;<br \/>\n# Creation Date: &lt;date&gt;<br \/>\n# Below is a simple program with several. &nbsp;You need to identify the issues and correct them.<\/p>\n<p>import random<br \/>\nimport time<\/p>\n<p>def displayIntro():<br \/>\n\tprint(&#8221;&#8217;You are in a land full of dragons. In front of you,<br \/>\n\tyou see two caves. In one cave, the dragon is friendly<br \/>\n\tand will share his treasure with you. The other dragon<br \/>\n\tis greedy and hungry, and will eat you on sight.&#8221;&#8217;)<br \/>\n\tprint()<\/p>\n<p>def chooseCave():<br \/>\n &nbsp;&nbsp;&nbsp;cave = &#8221;<br \/>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while cave != &#8216;1&#8217; and cave != &#8216;2&#8217;:<br \/>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(&#8216;Which cave will you go into? (1 or 2)&#8217;)<br \/>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cave = input()<\/p>\n<p> &nbsp;&nbsp;&nbsp;return caves<\/p>\n<p>def checkCave(chosenCave):<br \/>\n &nbsp;&nbsp;&nbsp;print(&#8216;You approach the cave&#8230;&#8217;)<br \/>\n &nbsp;&nbsp;&nbsp;#sleep for 2 seconds<br \/>\n &nbsp;&nbsp;&nbsp;time.sleep(2)<br \/>\n &nbsp;&nbsp;&nbsp;print(&#8216;It is dark and spooky&#8230;&#8217;)<br \/>\n &nbsp;&nbsp;&nbsp;#sleep for 2 seconds<br \/>\n &nbsp;&nbsp;&nbsp;time.sleep(3)<br \/>\n &nbsp;&nbsp;&nbsp;print(&#8216;A large dragon jumps out in front of you! He opens his jaws and&#8230;&#8217;)<br \/>\n &nbsp;&nbsp;&nbsp;print()<br \/>\n &nbsp;&nbsp;&nbsp;#sleep for 2 seconds<br \/>\n &nbsp;&nbsp;&nbsp;time.sleep(2)<br \/>\n &nbsp;&nbsp;&nbsp;friendlyCave = random.randint(1, 2)<\/p>\n<p> &nbsp;&nbsp;&nbsp;if chosenCave == str(friendlyCave):<br \/>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(&#8216;Gives you his treasure!&#8217;)<br \/>\n &nbsp;&nbsp;&nbsp;else:<br \/>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &#8216;Gobbles you down in one bite!&#8217;<\/p>\n<p>\ndisplayIntro()<br \/>\ncaveNumber = choosecave()<br \/>\ncheckCave(caveNumber)<br \/>\n &nbsp;&nbsp;&nbsp;<br \/>\nprint(&#8220;Thanks for planing&#8221;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reviewing other developer\u2019s work is essential. Reviewing the work of others makes both the reviewer and the reviewee better developers by allowing you to see how others might solve the same problem. It also ensures that standards are adhered to and offer the potential to catch logic errors that would otherwise end up in production.&nbsp; [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"disciplines":[344],"paper_types":[],"tagged":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions\/1060"}],"collection":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions"}],"about":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/types\/questions"}],"author":[{"embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/comments?post=1060"}],"version-history":[{"count":0,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions\/1060\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/media?parent=1060"}],"wp:term":[{"taxonomy":"disciplines","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/disciplines?post=1060"},{"taxonomy":"paper_types","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/paper_types?post=1060"},{"taxonomy":"tagged","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/tagged?post=1060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}