{"id":52,"date":"2020-03-27T02:32:24","date_gmt":"2020-03-27T02:32:24","guid":{"rendered":"https:\/\/www.mercerislandtech.com\/?page_id=52"},"modified":"2020-03-28T03:04:11","modified_gmt":"2020-03-28T03:04:11","slug":"py-lesson-3","status":"publish","type":"page","link":"https:\/\/www.mercerislandtech.com\/index.php\/corona-python\/py-lesson-3\/","title":{"rendered":"Py: Lesson 3"},"content":{"rendered":"\n<p>There is a &#8220;fruit&#8221; in each &#8220;riddle&#8221;.<\/p>\n\n\n\n<p>Solve the riddles using an algorithm:<\/p>\n\n\n\n<style>\n.code {\nwhite-space: pre-line;\n}\n<\/style>\n<p><code class=\"code\">riddles = \"\"\"Did you see a MAN GO by?\nHe found his home lonely after his dog\u2019s death.\nOne dare not rob an anaconda of its prey.\nThe crook made his escape armed with a gem.\nShe told her uncle money was what she needed more.\nIf I go out now, I shall miss my cousin.\nEither courage or anger made him move swiftly.\nThe beggar held out his cap pleading for money.\nMatters regarding rape should be dealt differently.\nThe English teacher Ryan teaches French too.\nHe saw his papa yawning at work.\nHe had kept on his lap lumpsum of money.\nAre classes for Telugu available in this city?\nIt is easy to shape a child rather than a man.\nHe is an extremely cheesy guy.\nCan I wear a khaki with a black shirt?\"\"\"\n\nfruit = \"\"\"A\u00e7a\u00ed\nAckee\nApple\nApricot\nAvocado\nBanana\nBilberry\nBlackberry\nBlackcurrant\nBlack sapote\nBlueberry\nBoysenberry\nBreadfruit\nBuddha's hand (fingered citron)\nCactus pear\nCrab apple\nCurrant\nCherry\nCherimoya (Custard Apple)\nChico fruit\nCloudberry\nCoconut\nCranberry\nDamson\nDate\nDragonfruit (or Pitaya)\nDurian\nElderberry\nFeijoa\nFig\nGoji berry\nGooseberry\nGrape\nRaisin\nGrapefruit\nGuava\nHala Fruit\nHoneyberry\nHuckleberry\nJabuticaba\nJackfruit\nJambul\nJapanese plum\nJostaberry\nJujube\nJuniper berry\nKiwano (horned melon)\nKiwifruit\nKumquat\nLemon\nLime\nLoganberry\nLoquat\nLongan\nLychee\nMango\nMangosteen\nMarionberry\nMelon\nCantaloupe\nGalia melon\nHoneydew\nWatermelon\nMiracle fruit\nMonstera Delisiousa\nMulberry\nNectarine\nNance\nOrange\nBlood orange\nClementine\nMandarine\nTangerine\nPapaya\nPassionfruit\nPeach\nPear\nPersimmon\nPlantain\nPlum\nPrune (dried plum)\nPineapple\nPineberry\nPlumcot (or Pluot)\nPomegranate\nPomelo\nPurple mangosteen\nQuince\nRaspberry\nSalmonberry\nRambutan (or Mamin Chino)\nRedcurrant\nSalal berry\nSalak\nSatsuma\nSoursop\nStar apple\nStar fruit\nStrawberry\nSurinam cherry\nTamarillo\nTamarind\nTangelo\nTayberry\nUgli fruit\nWhite currant\nWhite sapote\nYuzu\nBell pepper\nChile pepper\nCorn kernel\nCucumber\nEggplant\nJalape\u00f1o\nOlive\nPea\nPumpkin\nSquash\nTomato\nZucchini\"\"\"\n<\/code>\n<\/p>\n\n\n\n<p>Some tools you&#8217;ll want:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>string.find(substring) =&gt; index or -1<\/li><li>string.lower() =&gt; lowercase version of string<\/li><li>string.upper() =&gt; uppercase version of string<\/li><li>string.replace(old, new) =&gt; newString<\/li><li>string.split(&#8220;\\n&#8221;) =&gt; list of strings split at line breaks<\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/www.mercerislandtech.com\/wp-content\/uploads\/2020\/03\/challenge_fruit.txt\">Fruit Challenge.py<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a &#8220;fruit&#8221; in each &#8220;riddle&#8221;. Solve the riddles using an algorithm: riddles = &#8220;&#8221;&#8221;Did you see a MAN GO by? He found his home lonely after his dog\u2019s death. One dare not rob an anaconda of its prey. The crook made his escape armed with a gem. She told her uncle money was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":46,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-52","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/pages\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":5,"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/pages\/52\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/pages\/52\/revisions\/85"}],"up":[{"embeddable":true,"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/pages\/46"}],"wp:attachment":[{"href":"https:\/\/www.mercerislandtech.com\/index.php\/wp-json\/wp\/v2\/media?parent=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}