Explore your training options in 10 minutes

X

Back

Global navigation

Learn Python

Python is a popular programming language used to develop websites, analyze data, and automate tasks. These various Python articles provide information on courses, resources, books, and communities to help you learn this coding language. There is also a handy glossary of Python terminology, quizzes and exercises, and specific resources for various career paths.

Python TypeError: ‘NoneType’ object is not iterable Solution
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…
Python Queue and Deque: A Step-By-Step Guide
Python queue is a built in library that allows you to create a list that uses the FIFO rule, first in first out. Python deque uses the opposite rule, LIFO queue, or last in first out. Both operate on stacks…
Python Reverse List: A Step-by-Step Tutorial
You can reverse a list in Python using the built-in reverse() or reversed() methods. These methods will reverse the list without creating a new list. Python reverse() and reversed() will reverse the elements in the original list object. Reversing a…
Python NameError: name ‘self’ is not defined Solution
The value “self” is only available inside a method when a function is called and specified. You cannot access “self” in the arguments specified to a method, or inside a function without specifying “self” as an argument. Otherwise, you see…
Python ValueError: I/O operation on closed file Solution
You can only read from and write to a Python file if the file is open. If you try to access or manipulate a file that has been closed, the “ValueError : I/O operation on closed file” appears in your…
Python Find in List: A Beginner’s Guide
How do you find an item in a Python list? It’s a question all Python coders encounter at some point. Luckily, the language offers a number of ways in which you can find an item in a list, such as…
Python TypeError: ‘function’ object is not subscriptable Solution
Unlike iterable objects, you cannot access a value from a function using indexing syntax. Even if a function returns an iterable, you must assign the response from a function to a variable before accessing its values. Otherwise, you encounter an…
Python SyntaxError: non-default argument follows default argument Solution
An argument can have a default value in a Python function. If you specify arguments with default values, they must come after arguments without default values. Otherwise, you encounter a “SyntaxError: non-default argument follows default argument” error. In this guide,…
Python TypeError: ‘tuple’ object is not callable Solution
Tuples are enclosed within parentheses. This can be confusing because function calls also use parenthesis. If you use parentheses to access items from a tuple, or if you forget to separate tuples with a comma, you’ll encounter a “TypeError: 'tuple'…
Python TypeError: ‘float’ object not iterable Solution
Python can only iterate over an iterable object. This is a type of object that can return its members one at a time. If you try to iterate over a non-iterable object, like a floating-point number, you see an error…
Python TypeError: unhashable type: ‘dict’ Solution
The Python language is specific about what can be used as a key in a dictionary. In a Python dictionary, all keys must be hashable. If you try to use an unhashable key type when adding a key to a…
Python indentationerror: unindent does not match any outer indentation level Solution
Indenting your code can be a messy business if you try to use both spaces and tabs. In Python, using both methods of indentation results in an error. This error is “indentationerror: unindent does not match any outer indentation level”.…
Python ModuleNotFoundError Solution
Modules are integral to the Python language. Modules let you break down your code into multiple files. This helps maintain the readability and maintainability of a codebase. It’s common to encounter a ModuleNotFoundError when working with modules. In this guide,…
Python TypeError: not enough arguments for format string Solution
Python strings must be formatted using the correct number of arguments. When the number of arguments you specify is less than the number of values you want to format into a string, you encounter an error like “TypeError: not enough…
Python missing 1 required positional argument: ‘self’ Solution
Python classes need to be instantiated, or called, before you can access their methods. If you forget to instantiate an object of a class and try to access a class method, you encounter an error saying “missing 1 required positional…
Python typeerror: ‘>’ not supported between instances of ‘str’ and ‘int’ Solution
You can only compare items using mathematical operators if they have the same numerical data type. If you try to compare a string and an integer, you’ll encounter an error that says “not supported between instances of ‘str’ and ‘int’”.…
Python TypeError: ‘dict’ object is not callable Solution
Items in a Python dictionary must be called using the indexing syntax. This means you must follow a dictionary with square brackets and the key of the item you want to access. If you try to use curly brackets, Python…
Python takes 1 positional argument but 2 were given Solution
When you call a method associated with an object, there is one positional argument that is supplied by default: self. If you forget to include “self” when you define a method, you’ll encounter an error that says “takes 1 positional…
Python TypeError: string index out of range Solution
Like lists, Python strings are indexed. This means each value in a string has its own index number which you can use to access that value. If you try to access an index value that does not exist in a…
Python AttributeError: ‘str’ object has no attribute ‘append’ Solution
The append() method adds items to the end of a list. It cannot be used to add items to a string. Python returns an error stating “AttributeError: ‘str’ object has no attribute ‘append’” if you try to add values to…
Python TypeError: ‘int’ object is not callable Solution
Curly brackets in Python have a special meaning. They are used to denote a function invocation. If you specify a pair of curly brackets after an integer without an operator between them, Python thinks you’re trying to call a function.…
Python attributeerror: ‘list’ object has no attribute ‘split’ Solution
Python lists cannot be divided into separate lists based on characters that appear in the values of a list. This is unlike strings which values can be separated into a list. If you try to use the split() method on…
Rename Column in Pandas: A Beginner’s Guide
So you want to rename a column in a Python Pandas dataframe. Is that possible? Yes, it is. You use the rename() method to rename an individual column or the “columns” attribute to assign a new set of column headers…
Python typeerror: ‘str’ object is not callable Solution
Mistakes are easily made when you are naming variables. One of the more common mistakes is calling a variable “str”. If you try to use the Python method with the same name in your program,  “typeerror: ‘str’ object is not…
Python SyntaxError: unexpected EOF while parsing Solution
Python is a statically typed language. This means it’s strict about how code is written. If you forget to complete a code block in your code, you get an error like “SyntaxError: unexpected EOF while parsing”. This happens in a…
Python TypeError: unsupported operand type(s) for -: ‘str’ and ‘int’ Solution
Integer values cannot be subtracted from string values and vice versa. This is because strings and integers are separate data types. If you try to subtract a string from an integer, you receive an error like “TypeError: unsupported operand type(s)…
Python local variable referenced before assignment Solution
When you start introducing functions into your code, you’re bound to encounter an UnboundLocalError at some point. This error is raised when you try to use a variable before it has been assigned in the local context. In this guide,…
Python IndexError: tuple index out of range Solution
Like lists, Python tuples are indexed. This means each value in a tuple has a number you can use to access that value. When you try to access an item in a tuple that does not exist, Python returns an…
Python ValueError: invalid literal for int() with base 10 Solution
Python is good at converting values to different data types. You can convert strings to integers, integers to strings, floats to integers, to name a few examples. There’s one conversion Python does not like: changing a float structured as a…
Python valueerror: too many values to unpack (expected 2) Solution
Python does not unpack bags well. When you see the error “valueerror: too many values to unpack (expected 2)”, it does not mean that Python is unpacking a suitcase. It means you are trying to access too many values from…
Ad
At Career Karma, our mission is to empower users to make confident decisions by providing a trustworthy and free directory of bootcamps and career resources. We believe in transparency and want to ensure that our users are aware of how we generate revenue to support our platform.

Career Karma recieves compensation from our bootcamp partners who are thoroughly vetted before being featured on our website. This commission is reinvested into growing the community to provide coaching at zero cost to their members.

It is important to note that our partnership agreements have no influence on our reviews, recommendations, or the rankings of the programs and services we feature. We remain committed to delivering objective and unbiased information to our users.

In our bootcamp directory, reviews are purely user-generated, based on the experiences and feedback shared by individuals who have attended the bootcamps. We believe that user-generated reviews offer valuable insights and diverse perspectives, helping our users make informed decisions about their educational and career journeys.
Find the right bootcamp for you
X
GET MATCHED
By completing and submitting this form, you agree that Career Karma, LLC may deliver or cause to be delivered information, advertisements, and telemarketing messages regarding their services by email, call, text, recording, and message using a telephone system, dialer, automated technology or system, artificial or prerecorded voice or message device to your email and/or telephone number(s) (and not any other person’s email or telephone number) that you entered. Consent is not a condition of receiving information, receiving Career Karma services, or using the website, and you may obtain information by emailing info@careerkarma.com. Message & Data rates may apply. Message frequency may vary. Text STOP to unsubscribe. Terms of Service and Privacy Policy govern the processing and handling of your data.
X
By completing and submitting this form, you agree that Career Karma, LLC may deliver or cause to be delivered information, advertisements, and telemarketing messages regarding their services by email, call, text, recording, and message using a telephone system, dialer, automated technology or system, artificial or prerecorded voice or message device to your email and/or telephone number(s) (and not any other person’s email or telephone number) that you entered. Consent is not a condition of receiving information, receiving Career Karma services, or using the website, and you may obtain information by emailing info@careerkarma.com. Message & Data rates may apply. Message frequency may vary. Text STOP to unsubscribe. Terms of Service and Privacy Policy govern the processing and handling of your data.