Ad Code

6/recent/ticker-posts

Python | Identifiers | Keywords

Basic Concepts of Python

In this chapter we will learn some basic concepts of python. In last chapter , we learnt characteristics of python and installation of python . If you haven't seen it then click here

Python Identifiers

The identifiers are variable, function, modules and others object. In simple words , it is a name used to identify variables and functions.It starts from A to Z and a to z, It also contains underscore (_).  The numbers from 0 to 9 are also know as python identifiers. The main thing you have to keep in mind is that python does not allow any punctuation marks. Its a case sensitive language. For example, The Tech_Care and tech_Care these are two different things for python 

Here are some naming conventions for Python identifiers :-

  • Class names start with an uppercase letter. All other identifiers start with a lowercase letter.
  • Starting an identifier with a single leading underscore indicates that the identifier is private.
  • Starting an identifier with two leading underscores indicates a strongly private identifier.
  • If the identifier also ends with two trailing underscores, the identifier is a language-defined special name.

Reserved words

Here are some reserved words. The main important thing you cannot use them as constant or variable or any other identifier names. All the Python keywords contain lowercase letters only.


Comment in python

For commenting the line in python you have to simply start the line with Hashtag (#). This is known as single line comment. 

For Multi-Line comment you have to use triple quote ('''    ''') and python interpreter will siply ignore it.


Post a Comment

0 Comments

Ad Code