• 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. [smartslider3 […]

  • 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-673fc14426a37837864466/] 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-673fc14426b21058425285/] When you run above program, you will get below output: [crayon-673fc14426b24206734296/] 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 […]