{"id":12177,"date":"2020-06-05T10:57:12","date_gmt":"2020-06-05T17:57:12","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12177"},"modified":"2023-12-01T03:20:41","modified_gmt":"2023-12-01T11:20:41","slug":"python-map-function","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-map-function\/","title":{"rendered":"Python Map Function: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The Python map() function executes a function on each item in a collection, such as a list or a set. The map() function accepts a function and an object to apply that the function will operate on as arguments.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>When you\u2019re working with a list of items in Python, you may want to perform a specific function on each of those items.<\/p>\n\n\n\n<p>That&#8217;s where the Python built-in function map() comes in. The Python map function executes a function on all elements within an iterable object, such as a list, and returns map objects.<\/p>\n\n\n\n<p>In this tutorial, using a series of examples, we discuss how to use the <em>map()<\/em> function in Python.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Iterable Objects<\/h2>\n\n\n\n<p>Iterable objects are items that contain a countable number of values and that can be traversed. Lists, dictionaries, tuples, and sets are all iterable objects in Python as they can contain multiple values and can be traversed.<\/p>\n\n\n\n<p>Let\u2019s say that you have a list of student names that you want to store. Instead of storing these names in multiple <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variables<\/a>, you can declare an array to store the values:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>students = [\"Lucy\", \"Bill\", \"Graham\", \"Tommy\", \"Leslie\"]<\/pre><\/div>\n\n\n\n<p>Our <code>students<\/code> variable contains a list, which is an iterable object. This means that we can traverse through the items in the list.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Map Function Syntax<\/h2>\n\n\n\n<p>The map() function passes each element in a list and executes a function on each element. map() is built-in to Python. This means that you do not need to import any libraries to use the map() method.<\/p>\n\n\n\n<p>Python <em>map()<\/em> is a higher-order function that can be used to apply a specific function to multiple elements in an iterable object.  The syntax for the Python <em>map()<\/em> function is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>map(function, iterable)<\/pre><\/div>\n\n\n\n<p>The first argument the <em>map()<\/em> function takes is the <strong>function. <\/strong>This is the function that will be executed on every item in the iterable. The <strong>iterable<\/strong> is the object that will be mapped, such as a list, tuple, dictionary, or set.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use the Map Function in Python<\/h2>\n\n\n\n<p>Say you are an administrator at a school that has been tasked with creating a full student roster. <\/p>\n\n\n\n<p>We decide to print out a list of student names with each student\u2019s class grade listed next to their name. This will prevent confusion if two students in two different grades have the same name.<\/p>\n\n\n\n<p>This is a perfect application of the Python map() function. We have an iterable upon which we want to execute a function. The function will merge a student&#8217;s name with the grade they are in. Here\u2019s a program that could be used to merge the names of students with their grade level:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def mergeNamesAndGrades(name):\n\treturn name + \" First Grade\"\nstudents = [\"Lucy\", \"Bill\", \"Graham\", \"Tommy\", \"Leslie\"]\nstudent_roster = map(mergeNamesAndGrades, students)<\/pre><\/div>\n\n\n\n<p>On the first two lines, we declare a <a href=\"https:\/\/careerkarma.com\/blog\/python-functions\/\">Python function<\/a> called <em>mergeNamesAndGrades<\/em>. This function combines each student\u2019s name with <em>First Grade<\/em>.&nbsp;<\/p>\n\n\n\n<p>Then, on the next line, we define the list of students in our school. THere are five students in our list.<\/p>\n\n\n\n<p>The <em>map()<\/em> function is applied to the contents of the <em>student_roster<\/em> <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a>. The map() function takes in two arguments: the function (in this case, mergeNamesAndGrades) and the iterable object (students).&nbsp;<\/p>\n\n\n\n<p>The map() method applies the mergeNamesAndGrades() function to each student in our list.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Converting a Python Map to a List<\/h3>\n\n\n\n<p>However, our program is not yet complete. The <em>map()<\/em> function returns a mapped object, not our complete list. If we print out our <em>student_roster<\/em> variable right now, our code will return a mapped object like this:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&lt;map object at 0x7f2c74103890&gt;<\/pre><\/div>\n\n\n\n<p>This output was generated because the <em>map()<\/em> function returns its own custom object, rather than a list. So, if we want to print out the list of student names, we need to convert our <em>student_roster<\/em> variable to a list. Here\u2019s the code we can use to perform this action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(list(student_roster))<\/pre><\/div>\n\n\n\n<p>Our code returns the following <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">Python list<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Lucy First Grade', 'Bill First Grade', 'Graham First Grade', 'Tommy First Grade', 'Leslie First Grade']<\/pre><\/div>\n\n\n\n<p>Let\u2019s look at another example. Say that we want to convert every student\u2019s name and grade into upper case for our student roster. We could use the following code to change the cases of the student names and grades:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def changeCase(name):\n\treturn name.upper()\nstudent_roster = ['Lucy First Grade', 'Bill First Grade', 'Graham First Grade', 'Tommy First Grade', 'Leslie First Grade']\nfinal_student_roster = map(changeCase, student_roster)\nprint(list(final_student_roster))<\/pre><\/div>\n\n\n\n<p>Our code returns a list over which we can iterate:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['LUCY FIRST GRADE', 'BILL FIRST GRADE', 'GRAHAM FIRST GRADE', 'TOMMY FIRST GRADE', 'LESLIE FIRST GRADE']<\/pre><\/div>\n\n\n\n<p>In this example, we defined a function called <em>changeCase. <\/em>This function changed each student name to uppercase. We used the Python <em>upper()<\/em> function to convert the case of each name.<\/p>\n\n\n\n<p>Our program used the <em>map()<\/em> function to call <em>changeCase()<\/em> on each object in our iterable <em>student_roster<\/em>. Finally, our program returned the revised list of student names in capital letters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Map Function with Lambda<\/h2>\n\n\n\n<p>The Python <em>map() <\/em>function can be used with the <em>lambda<\/em> function to make our code more efficient. In the above examples, we declared a new function to change our iterable in a certain way.<\/p>\n\n\n\n<p>But if we only want to perform an action on an iterable object once, it\u2019s not necessary to declare a new function. Instead, we can use the Python lambda function, which is a small, anonymous function.<\/p>\n\n\n\n<p><a href=\"https:\/\/careerkarma.com\/blog\/python-lambda-functions\/\">Lambda functions<\/a> can be used with <em>map()<\/em> for small functions where we don\u2019t want to define a new function.<\/p>\n\n\n\n<p>Because lambda functions are more concise than regular functions, you should try to use them when you can. Using lambda functions for simple functions will help improve the readability of your code.<\/p>\n\n\n\n<p>Here\u2019s an example of lambda being used to convert the case of a list of student names to uppercase, like we did above:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>student_roster = ['Lucy First Grade', 'Bill First Grade', 'Graham First Grade', 'Tommy First Grade', 'Leslie First Grade']\nfinal_student_roster = map(lambda s: s.upper(), student_roster)\nprint(list(final_student_roster))<\/pre><\/div>\n\n\n\n<p>We did not declare a new function to convert the cases of our student names to uppercase. Instead, we used <em>lambda s: s.upper()<\/em>, which is a small, anonymous function that will convert the cases of our student names.&nbsp;<\/p>\n\n\n\n<p>Our code returns the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['LUCY FIRST GRADE', 'BILL FIRST GRADE', 'GRAHAM FIRST GRADE', 'TOMMY FIRST GRADE', 'LESLIE FIRST GRADE']<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Python <em>map()<\/em> function can be used to apply a specific function to all elements within an iterable object. For example, you can use map() to convert the cases of a list of strings to uppercase. Or, you could use the map() function multiply a list of numbers by a certain amount.<\/p>\n\n\n\n<p>In this tutorial, we discussed how you can use <em>map()<\/em> in Python to apply a function to all elements within an iterable object. We also discussed how you can use Python\u2019s lambda function with <em>map()<\/em> to create more efficient code.<\/p>\n\n\n\n<p>You\u2019re now equipped with the <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">Python knowledge<\/a> you need to start using  <em>map()<\/em> like a pro.<\/p>\n","protected":false},"excerpt":{"rendered":"The Python map() function executes a function on each item in a collection, such as a list or a set. The map() function accepts a function and an object to apply that the function will operate on as arguments. When you\u2019re working with a list of items in Python, you may want to perform a&hellip;","protected":false},"author":240,"featured_media":12179,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[12687],"class_list":{"0":"post-12177","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"tag-tutorial"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Map Function: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-map-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Map Function: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-map-function\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-05T17:57:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:20:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Map Function: A Step-By-Step Guide\",\"datePublished\":\"2020-06-05T17:57:12+00:00\",\"dateModified\":\"2023-12-01T11:20:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/\"},\"wordCount\":1057,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg\",\"keywords\":[\"tutorial\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-map-function\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/\",\"name\":\"Python Map Function: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg\",\"datePublished\":\"2020-06-05T17:57:12+00:00\",\"dateModified\":\"2023-12-01T11:20:41+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-map-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-map-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Map Function: A Step-By-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Map Function: A Step-By-Step Guide | Career Karma","description":"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.","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:\/\/careerkarma.com\/blog\/python-map-function\/","og_locale":"en_US","og_type":"article","og_title":"Python Map Function: A Step-By-Step Guide","og_description":"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-map-function\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-05T17:57:12+00:00","article_modified_time":"2023-12-01T11:20:41+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Map Function: A Step-By-Step Guide","datePublished":"2020-06-05T17:57:12+00:00","dateModified":"2023-12-01T11:20:41+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/"},"wordCount":1057,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg","keywords":["tutorial"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-map-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/","url":"https:\/\/careerkarma.com\/blog\/python-map-function\/","name":"Python Map Function: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg","datePublished":"2020-06-05T17:57:12+00:00","dateModified":"2023-12-01T11:20:41+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The Python \u201cmap\u201d function applies a function to all items in an iterable object. Learn how the Python map function works on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-map-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-MAP-FUNCTION.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-map-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python Map Function: A Step-By-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=12177"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12177\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12179"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}