{"id":21465,"date":"2020-08-20T09:56:23","date_gmt":"2020-08-20T16:56:23","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=21465"},"modified":"2023-12-01T03:58:04","modified_gmt":"2023-12-01T11:58:04","slug":"python-typeerror-nonetype-object-is-not-iterable","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/","title":{"rendered":"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution"},"content":{"rendered":"\n<p>With Python, you can only iterate over an object if that object has a value. This is because iterable objects only have a next item which can be accessed if their value is not equal to None. If you try to iterate over a None object, you encounter the <code>TypeError: \u2018NoneType\u2019 object is not iterable<\/code> error.<br><\/p>\n\n\n\n<p>In this guide, we talk about what this error means and why you may encounter it. We walk through an example to help you solve how to solve this common Python error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-typeerror-nonetype-object-is-not-iterable\">TypeError: \u2018NoneType\u2019 object is not iterable<\/h2>\n\n\n\n<p>For an object to be <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">iterable<\/a>, it must contain a value. A None value is not iterable because it does not contain any objects. None represents a null value.<br><\/p>\n\n\n\n<p>There is a difference between a None object and an empty iterable. This error is not raised if you have any empty list or a string.<br><\/p>\n\n\n\n<p>This is because <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">lists<\/a> and <a href=\"https:\/\/careerkarma.com\/blog\/python-string-methods\/\">strings<\/a> have an iterable data type. When the Python interpreter encounters an empty list, it does not iterate over it because there are no values. Python cannot iterate over a None value so the interpreter returns an error.<br><\/p>\n\n\n\n<p>This error is common when you declare a function and forget to return a value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-an-example-scenario\">An Example Scenario<\/h2>\n\n\n\n<p>Let\u2019s write a program that takes a list of student names and filters out those that begin with \u201cE\u201d. We\u2019ll print those values to the console.<br><\/p>\n\n\n\n<p>Start by defining a <a href=\"https:\/\/careerkarma.com\/blog\/python-functions\/\">function<\/a> that filters out the students\u2019 names:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def filter_students(class_names):\n\tnew_class_names = []\n\tfor c in class_names:\n\t\tif c.startswith(&quot;E&quot;):\n\t\t\tnew_class_names.append(c)<\/pre><\/div>\n\n\n\n<p>This function loops through every item in the \u201cclass_names\u201d list using a for loop. For each item, our loop checks if the item begins with the letter \u201cE\u201d. If it does, that name is added to the \u201cnew_class_names\u201d list.<br><\/p>\n\n\n\n<p>Next, write a function that goes through our new list and prints out each value to the console:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def show_students(class_names):\n\tfor c in class_names:\n\t\tprint(c)<\/pre><\/div>\n\n\n\n<p>Here, we declare a list of students through which our program should search. We pass this list of students through our filter_students function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>students = [&quot;Elena&quot;, &quot;Peter&quot;, &quot;Chad&quot;, &quot;Sam&quot;]\nstudents_e_name = filter_students(students)<\/pre><\/div>\n\n\n\n<p>This code executes the filter_students function which finds all the students whose names start with \u201cE\u201d. The list of students whose names begin with \u201cE\u201d is called students_e_name. Next, we call our show_students function to show the new list of students:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>show_students(students_e_name)<\/pre><\/div>\n\n\n\n<p>Let\u2019s run our code and see what happens:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Traceback (most recent call last):\n  File &quot;main.py&quot;, line 14, in &lt;module&gt;\n\tshow_students(students_e_name)\n  File &quot;main.py&quot;, line 8, in show_students\n\tfor c in class_names:\nTypeError: 'NoneType' object is not iterable<\/pre><\/div>\n\n\n\n<p>Our code returns an error message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-solution\">The Solution<\/h2>\n\n\n\n<p>When we try to iterate over the <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">variable<\/a> class_names in the show_students function, our code detects a None value and raises an error. This is because the value we have passed as \u201cclass_names\u201d is None.<br><\/p>\n\n\n\n<p>This error is caused because our filter_students function does not return a value. When we assign the result of the filter_students function to the variable students_e_name, the value None is set.<br><\/p>\n\n\n\n<p>To solve this error, we have to <a href=\"https:\/\/careerkarma.com\/blog\/python-return\/\">return a value in our filter_students function<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def filter_students(class_names):\n\tnew_class_names = []\n\tfor c in class_names:\n\t\tif c.startswith(&quot;E&quot;):\n\t\t\tnew_class_names.append(c)\n      # We have added a return statement here\n\treturn new_class_names\n        \ndef show_students(class_names):\n\tfor c in class_names:\n\t\tprint(c)\n    \nstudents = [&quot;Elena&quot;, &quot;Peter&quot;, &quot;Chad&quot;, &quot;Sam&quot;]\nstudents_e_name = filter_students(students)\n\nshow_students(students_e_name)<\/pre><\/div>\n\n\n\n<p>This code returns the value of new_class_names back to the main program.<br><\/p>\n\n\n\n<p>Let\u2019s run our code to see if it works:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Elena<\/pre><\/div>\n\n\n\n<p>Our code now successfully prints out the names of the students whose names begin with \u201cE\u201d.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-avoiding-the-nonetype-exception\">Avoiding the NoneType Exception<\/h2>\n\n\n\n<p>Technically, you can avoid the NoneType exception by checking if a value is equal to None before you iterate over that value. Consider the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def filter_students(class_names):\n\tnew_class_names = []\n\tfor c in class_names:\n\t\tif c.startswith(&quot;E&quot;):\n\t\t\tnew_class_names.append(c)\n\treturn new_class_names\n\ndef show_students(class_names):\n\tif class_names is not None:\n\t\tfor c in class_names:\n\t\t\tprint(c)\n            \nstudents = [&quot;Elena&quot;, &quot;Peter&quot;, &quot;Chad&quot;, &quot;Sam&quot;]\nstudents_e_name = filter_students(students)\n\nshow_students(students_e_name)<\/pre><\/div>\n\n\n\n<p>The &#8220;show_students()&#8221; function executes successfully because we check if class_names is a None value before we try to iterate over it. This is not a best practice in most cases because the cause of a NoneType error can be a problem somewhere else in your code.<br><\/p>\n\n\n\n<p>If we add in the \u201cis not None\u201d check into our full program, we don\u2019t know we missed a return statement in another function. That\u2019s why if you see this error, you are best to accept the exception rather than handle it using an \u201cis not None\u201d check.<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/repl.it\/@careerkarma\/NoneType-object-is-not-iterable?lite=true\" width=\"100%\" height=\"400px\" frameborder=\"0\"><\/iframe>\n<br>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>The <code>TypeError: \u2018NoneType\u2019 object is not iterable<\/code> error is raised when you try to iterate over an object whose value is equal to None.<br><\/p>\n\n\n\n<p>To solve this error, make sure that any values that you try to iterate over have been assigned an iterable object, like a string or a list. In our example, we forgot to add a \u201creturn\u201d statement to a function. This made the function return None instead of a list.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to solve this common Python error in your own code.<\/p>\n","protected":false},"excerpt":{"rendered":"With Python, you can only iterate over an object if that object has a value. This is because iterable objects only have a next item which can be accessed if their value is not equal to None. If you try to iterate over a None object, you encounter the TypeError: \u2018NoneType\u2019 object is not iterable&hellip;","protected":false},"author":240,"featured_media":10224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-21465","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"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 TypeError: \u2018NoneType\u2019 object is not iterable Solution | CK<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.\" \/>\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-typeerror-nonetype-object-is-not-iterable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\" \/>\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-08-20T16:56:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:58:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"666\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution\",\"datePublished\":\"2020-08-20T16:56:23+00:00\",\"dateModified\":\"2023-12-01T11:58:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\"},\"wordCount\":736,\"commentCount\":3,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\",\"name\":\"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution | CK\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg\",\"datePublished\":\"2020-08-20T16:56:23+00:00\",\"dateModified\":\"2023-12-01T11:58:04+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg\",\"width\":1000,\"height\":666},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#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 TypeError: \u2018NoneType\u2019 object is not iterable Solution\"}]},{\"@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 TypeError: \u2018NoneType\u2019 object is not iterable Solution | CK","description":"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.","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-typeerror-nonetype-object-is-not-iterable\/","og_locale":"en_US","og_type":"article","og_title":"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution","og_description":"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.","og_url":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-20T16:56:23+00:00","article_modified_time":"2023-12-01T11:58:04+00:00","og_image":[{"width":1000,"height":666,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution","datePublished":"2020-08-20T16:56:23+00:00","dateModified":"2023-12-01T11:58:04+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/"},"wordCount":736,"commentCount":3,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/","url":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/","name":"Python TypeError: \u2018NoneType\u2019 object is not iterable Solution | CK","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg","datePublished":"2020-08-20T16:56:23+00:00","dateModified":"2023-12-01T11:58:04+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about the Python TypeError: \u2018NoneType\u2019 object is not iterable, how the error works, and how to solve the error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/joshua-aragon-FkjaN-7gWC0-unsplash.jpg","width":1000,"height":666},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-nonetype-object-is-not-iterable\/#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 TypeError: \u2018NoneType\u2019 object is not iterable Solution"}]},{"@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\/21465","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=21465"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21465\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/10224"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=21465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=21465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=21465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}