{"id":3194,"date":"2025-01-15T08:36:17","date_gmt":"2025-01-15T08:36:17","guid":{"rendered":"https:\/\/gnomeledge.com\/QH2301B\/?p=3194"},"modified":"2025-01-17T05:29:17","modified_gmt":"2025-01-17T05:29:17","slug":"hackerrank-tutorial-6-write-a-function-challenge","status":"publish","type":"post","link":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/","title":{"rendered":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge"},"content":{"rendered":"\n<p><strong>Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.<\/strong>&nbsp;<strong>Ref:&nbsp;<a href=\"https:\/\/www.hackerrank.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.hackerrank.com\/<\/a><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1-1024x555.jpg\" alt=\"\" class=\"wp-image-3196\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1-1024x555.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1-300x163.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1-768x416.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1-1536x832.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 2 \u2013 Under Python click \u201cContinue Preparation\u201d. Choose \u201cDivision\u201d Challenge.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2-1024x555.jpg\" alt=\"\" class=\"wp-image-3197\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2-1024x555.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2-300x163.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2-768x416.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2-1536x832.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_2.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 3 \u2013 Read the Instructions Carefully.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"917\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3A.jpg\" alt=\"\" class=\"wp-image-3198\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3A.jpg 839w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3A-274x300.jpg 274w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3A-768x839.jpg 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"920\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3B.jpg\" alt=\"\" class=\"wp-image-3199\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3B.jpg 852w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3B-278x300.jpg 278w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_3B-768x829.jpg 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><\/figure>\n\n\n\n<p><strong>Step 4 \u2013 List the Requirements and Constraints in a Notepad in simple words. Learn to take notes.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4-1024x594.jpg\" alt=\"\" class=\"wp-image-3200\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4-1024x594.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4-300x174.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4-768x446.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4-1536x892.jpg 1536w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_4.jpg 1645w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 5 \u2013 Convert What You Understand of the\u00a0<strong>Requirements and Constraints<\/strong>\u00a0into code<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_5-1024x503.jpg\" alt=\"\" class=\"wp-image-3202\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_5-1024x503.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_5-300x147.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_5-768x377.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_5.jpg 1063w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>There are many solutions to solve a logic problems.<\/p>\n\n\n\n<p>Why in this instance was &#8220;if year can be evenly divided by 4&#8221; &gt; converted into &gt; if year % 4 == 0:<\/p>\n\n\n\n<p>% will provide a remainder of a division. If the remainder is 0 it means whatever number year contains, it can be evenly divided by 4. Which fits the requirements.<\/p>\n\n\n\n<p><em>Example if year is = 100 <\/em><\/p>\n\n\n\n<p><em>100\/ 4 = Value of 25 AND Remainder of 0<\/em><\/p>\n\n\n\n<p><em>If remainder is 0, then it is evenly divided by 4 and we can set leap year as True.<\/em><\/p>\n\n\n\n<p>This solution is adapted for even division of 100 and 400 logic.<\/p>\n\n\n\n<p><strong>Step 6 \u2013 Click \u201cRun Code\u201d to Test Your Code. Do Note if you submit code with errors, you will lose points. So \u201cRun Code\u201d first to ensure everything works.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"672\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_6-1024x672.jpg\" alt=\"\" class=\"wp-image-3201\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_6-1024x672.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_6-300x197.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_6-768x504.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_6.jpg 1037w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 7 \u2013 Once you have tested that your code works, \u201cSubmit Code\u201d to clear the challenge and earn some Hacker points.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"727\" src=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_7-1024x727.jpg\" alt=\"\" class=\"wp-image-3203\" srcset=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_7-1024x727.jpg 1024w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_7-300x213.jpg 300w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_7-768x545.jpg 768w, https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/PT5_7.jpg 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.&nbsp;Ref:&nbsp;https:\/\/www.hackerrank.com\/ Step 2 \u2013 Under Python click \u201cContinue Preparation\u201d. Choose \u201cDivision\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Step 4 \u2013 List the Requirements and Constraints in a Notepad in simple words. Learn to take notes. Step 5 \u2013 Convert What You Understand of the\u00a0Requirements [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3195,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[360,365,370,3,256,174,375,366,9,371],"tags":[],"class_list":["post-3194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ambition","category-competitive-programming","category-hackerrank","category-ite","category-learning-through-experimentations","category-methods-and-techniques","category-python","category-ranking-up","category-student-development","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge<\/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:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge\" \/>\n<meta property=\"og:description\" content=\"Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.&nbsp;Ref:&nbsp;https:\/\/www.hackerrank.com\/ Step 2 \u2013 Under Python click \u201cContinue Preparation\u201d. Choose \u201cDivision\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Step 4 \u2013 List the Requirements and Constraints in a Notepad in simple words. Learn to take notes. Step 5 \u2013 Convert What You Understand of the\u00a0Requirements [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\" \/>\n<meta property=\"og:site_name\" content=\"Gnome Ledge\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-15T08:36:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-17T05:29:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Wei Jing HO\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wei Jing HO\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\"},\"author\":{\"name\":\"Wei Jing HO\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5\"},\"headline\":\"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge\",\"datePublished\":\"2025-01-15T08:36:17+00:00\",\"dateModified\":\"2025-01-17T05:29:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\"},\"wordCount\":201,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp\",\"articleSection\":[\"Ambition\",\"Competitive Programming\",\"HackerRank\",\"ITE\",\"Learning through Experimentations\",\"Methods and Techniques\",\"Python\",\"Ranking Up\",\"Student Development\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\",\"name\":\"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge\",\"isPartOf\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp\",\"datePublished\":\"2025-01-15T08:36:17+00:00\",\"dateModified\":\"2025-01-17T05:29:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp\",\"contentUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/gnomeledge.com\/QH2301B\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#website\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/\",\"name\":\"Gnome Ledge\",\"description\":\"Seekers of Knowledge\",\"publisher\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\"},\"alternateName\":\"Class QH2301B\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gnomeledge.com\/QH2301B\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#organization\",\"name\":\"Gnome Ledge\",\"alternateName\":\"Class QH2301B\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png\",\"contentUrl\":\"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png\",\"width\":40,\"height\":67,\"caption\":\"Gnome Ledge\"},\"image\":{\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/averageone.com\/\",\"https:\/\/www.linkedin.com\/in\/howeijing-wr\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5\",\"name\":\"Wei Jing HO\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g\",\"caption\":\"Wei Jing HO\"},\"sameAs\":[\"https:\/\/averageone.com\/\"],\"url\":\"https:\/\/gnomeledge.com\/QH2301B\/author\/mr-ho\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge","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:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/","og_locale":"en_US","og_type":"article","og_title":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge","og_description":"Step 1 \u2013 Launch the HackerRank Website and \u201cSign In\u201d.&nbsp;Ref:&nbsp;https:\/\/www.hackerrank.com\/ Step 2 \u2013 Under Python click \u201cContinue Preparation\u201d. Choose \u201cDivision\u201d Challenge. Step 3 \u2013 Read the Instructions Carefully. Step 4 \u2013 List the Requirements and Constraints in a Notepad in simple words. Learn to take notes. Step 5 \u2013 Convert What You Understand of the\u00a0Requirements [&hellip;]","og_url":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/","og_site_name":"Gnome Ledge","article_published_time":"2025-01-15T08:36:17+00:00","article_modified_time":"2025-01-17T05:29:17+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp","type":"image\/webp"}],"author":"Wei Jing HO","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wei Jing HO","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#article","isPartOf":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/"},"author":{"name":"Wei Jing HO","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5"},"headline":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge","datePublished":"2025-01-15T08:36:17+00:00","dateModified":"2025-01-17T05:29:17+00:00","mainEntityOfPage":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/"},"wordCount":201,"commentCount":0,"publisher":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp","articleSection":["Ambition","Competitive Programming","HackerRank","ITE","Learning through Experimentations","Methods and Techniques","Python","Ranking Up","Student Development","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/","url":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/","name":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge - Gnome Ledge","isPartOf":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp","datePublished":"2025-01-15T08:36:17+00:00","dateModified":"2025-01-17T05:29:17+00:00","breadcrumb":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#primaryimage","url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp","contentUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2025\/01\/DALL\u00b7E-2025-01-15-16.27.55-A-captivating-digital-artwork-of-a-Malay-boy-traveling-back-in-time-standing-in-awe-before-an-ancient-sundial-surrounded-by-strings-of-glowing-acid-b.webp","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/gnomeledge.com\/QH2301B\/2025\/01\/15\/hackerrank-tutorial-6-write-a-function-challenge\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gnomeledge.com\/QH2301B\/"},{"@type":"ListItem","position":2,"name":"[HackerRank] Tutorial 6: \u201cWrite A Function\u201d Challenge"}]},{"@type":"WebSite","@id":"https:\/\/gnomeledge.com\/QH2301B\/#website","url":"https:\/\/gnomeledge.com\/QH2301B\/","name":"Gnome Ledge","description":"Seekers of Knowledge","publisher":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization"},"alternateName":"Class QH2301B","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gnomeledge.com\/QH2301B\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gnomeledge.com\/QH2301B\/#organization","name":"Gnome Ledge","alternateName":"Class QH2301B","url":"https:\/\/gnomeledge.com\/QH2301B\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/","url":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png","contentUrl":"https:\/\/gnomeledge.com\/QH2301B\/wp-content\/uploads\/2023\/01\/cropped-cropped-icon_gnome_1-1.png","width":40,"height":67,"caption":"Gnome Ledge"},"image":{"@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/averageone.com\/","https:\/\/www.linkedin.com\/in\/howeijing-wr\/"]},{"@type":"Person","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/6895e6c29fbf0423d8b9b25fe6ead8f5","name":"Wei Jing HO","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gnomeledge.com\/QH2301B\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36cf9b99a7f988a70d4ab76145bc594be673e5f440a112c6b54f22638524203c?s=96&d=mm&r=g","caption":"Wei Jing HO"},"sameAs":["https:\/\/averageone.com\/"],"url":"https:\/\/gnomeledge.com\/QH2301B\/author\/mr-ho\/"}]}},"_links":{"self":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/comments?post=3194"}],"version-history":[{"count":2,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3194\/revisions"}],"predecessor-version":[{"id":3236,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/posts\/3194\/revisions\/3236"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/media\/3195"}],"wp:attachment":[{"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/media?parent=3194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/categories?post=3194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gnomeledge.com\/QH2301B\/wp-json\/wp\/v2\/tags?post=3194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}