• 29 December

    [Fixed] no module named ‘sklearn.cross_validation’

    Learn about how to fix modulenotfounderror:no module named 'sklearn.cross_validation' in Python

  • 07 April

    TypeError: ‘NoneType’ object is not iterable

    In this post, we will see about TypeError: 'NoneType' object is not iterable. You will get this error if you are iterating over object of type None in for or while loop. Let’s understand with help of example. [crayon-600664d5a1921358665538/] If countryList is of type None, then you can get this error. Let’s see a scenario […]

  • 07 April

    TypeError: unhashable type: ‘list’

    In this post, we will see about TypeError: unhashable type: 'list'. You will get this error when you are trying to put list as key in dictionary or set because list is unhashable object.TypeError: unhashable type is generally raised when you try to hash object which is unhashable. Let’s see this with help of example: […]

  • 07 April

    Indexerror: list Index Out of Range

    In this post, we will see about Indexerror: list Index Out of Range in Python. While working with list, you can access its elements by its index. You will get this error when you are trying to access an index that does not exist. Let’s see with the help of example. Output: [crayon-600664d5a1fc8531631172/] You will […]

  • 07 April

    Valueerror: Invalid literal for int() with base 10

    In this post, we will see about Valueerror: Invalid literal for int() with base 10. You will see this error, when you are trying to convert string to int using int() function. If you provide invalid string input to int() function, you will get this error. Here is the slider to understand it better. Let’s […]

  • 07 April

    TypeError: String Indices Must be Integers

    In this post, we will see about TypeError: String Indices Must be Integers in Python. You can access the characters of string by its index. Each index specifies the position for the character. For example: Let’s say you want to print 3rd element of the String 'Java2blog', you can use str1[2]. [crayon-600664d5a27ad634031177/] Output: v If […]

  • 05 April

    Local variable referenced before assignment

    In this post, we will see about error Local variable referenced before assignment in Python. Problem Let me explain this error with the help of an example. [crayon-600664d5a2a32849913455/] When you run above program, you will get below output: [crayon-600664d5a2a36327774328/] Let’s understand why we are getting this error UnboundLocalError. When Python interpreter parses any function definition […]

  • 04 April

    SyntaxError: ‘Return’ Outside Function

    In this post, we will see about SyntaxError: 'Return' Outside Function in Python. This error will generally occur when you do not put the return statement indentation properly with function definition. 💡 Did you know? Unlike C,C++ or java, Python uses whitespace for indentation. All statements which are at same distance on right belong to […]

  • 01 April

    SyntaxError: eol while scanning string literal

    In this post, we will see about SyntaxError eol while scanning string literal. SyntaxError are raised when python interpreter is translating source code in bytes and it generally means there is something wrong with the syntax. These errors are also easy to figure out and fix as well. You will get SyntaxError eol while scanning […]