In this tutorial, we will learn about the Identifiers in Python . How to use them with the help of examples.

Any name in python like function-name, class-name, variable-name…etc is called identifiers in Python. The identifier must obey fallowing rules.

  • The identifier contains a-z , A-Z, 0-9, _ but should not start with numeric & does not allows special symbols.
  • We cannot use special symbols like !, @, #, $, % etc. in our identifier.
  • Identifier can be of any length.
  • The identifiers are case sensitive.
  • Keywords are not allowed as identifier. (global, del are keywords)
  • Is it possible to use predefined class-name & data types names as a identifier but not recommended.

Python Comments

Comments are use to write description about application logics to understand the logics easily. The main objective comments the code maintenance will become easy. The comments are non-executable code.

Python logo
Python logo

There are two types of comment

  • Single line comment
    • write the description in single line & it starts with #
  • Multiline comment
    • write the description in more than one line starts with “”” ends with : “”””(triple quotes)
    • In python while writing the comments we can write double quote or single quote (“) or (‘).

Indentation error in Python

  • Python uses whitespace (spaces and tabs) to define program blocks whereas other languages like C, C++ use braces ({}) to indicate blocks of codes for class, functions or flow control.
  • The number of whitespaces (spaces and tabs) in the indentation is not fixed, but all statements within the block must be the indented same amount. In the following program, the block statements have no indentation.

If you have any queries regarding this article or if I have missed something on this topic, please feel free to add in the comment down below for the audience. See you guys in another article.

To know more about Python Wikipedia please click here .

Stay Connected Stay Safe, Thank you


Basic Engineer

Hey Readers! We have more than fifteen years of experience in Software Development, IoT, Telecom, Banking, Finance and Embedded domain. Currently we are actively working on Data Science, ML and AI with multiple market leaders worldwide. Happy Reading. Cheers!

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *