• 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. [crayon-604266d0839ae427522338/] Output: [crayon-604266d0839b7631695627/] You […]

  • 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-604266d084aa5303898099/] 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-604266d084d2b397468386/] When you run above program, you will get below output: [crayon-604266d084d32401843112/] 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 […]

  • 24 December

    TypeError: ‘list’ object is not callable

    In this post, we will see how to resolve TypeError: ‘list’ object is not callable in python. Let’s first understand why we get this error. In python, a built-in name is a name in which the python interpreter assigns predefined value. The value can be objects, functions or classes. All these built-in names will be […]