Skip to content
Home » Keywords & Identifiers In Python | Python Tutorial #2

Keywords & Identifiers In Python | Python Tutorial #2

Python Tutorial #2

In this Post we will Learn About keywords & Identifiers(Names assigned to Variables, functions) In Python, So if you Have not Read the First Part of this Course you can Check it Out Here: Python Course | Getting Started With Python.

What are Keywords In Python?

Keywords are reserved words in Python. We cannot use keywords as variable names, function names or any other identifiers. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive. There are 33 keywords in Python

All the Keywords are In Lowercase Except True, False and None.

Keywords In Python:

Falseawaitelseimportpass
Nonebreakexceptinraise
Trueclassfinallyisreturn
andcontinueforlambdatry
asdeffromnonlocalwhile
assertdelglobalnotwith
asyncelififoryield

So you can see the Table for All the Keywords Used In Python, We will be Using Most of them In Our Future Projects. So Now moving on to Python Identifiers.

Python Identifiers

Identifiers are names given to entities like classes, functions, variables, etc. It makes it possible to distinguish one entity from another.

Some Rules to Follow While Writing Identifiers:

1. The identifier can be a combination of lowercase (a-z) or uppercase (A-Z) letters or numbers (0-9) or the underscore _. Names like myClass, var_1 and print_this_to_screen are all valid examples.

2. Identifiers cannot start with a number. 1var is not valid, but var1 is a valid name.

3. Keywords cannot be used with Identifiers

4. We cannot use Special Characters like #,$,& with Identifiers

5. An identifier can be of any length

Things to Keep In Mind:

  • Python is a case-sensitive language that means In Python Programmer1 & programer1 are Two Different Variables.
  • To Seperate Long Tail Keywords start use of Underscore(‘_’) In your Code, Like mr_programmer_is_a_good_programmer.

So this was it For this Blog if you haven’t Read the Previous Make Sure to Read Here: Python Course | Getting Started With Python.

2 thoughts on “Keywords & Identifiers In Python | Python Tutorial #2”

  1. Pingback: Python Statement, Indentation and Comments | Python Course #3 - Mr Programmer

  2. Pingback: Python Data Types | Python Course #5 - Mr Programmer

Leave a Reply

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

You cannot copy content of this page

Top 10 Programming Languages to Learn In 2023! 9 Best Extensions For Web Developers! | Chrome Extensions For Web Developers Web Development Roadmap Best Resources to Learn PYTHON FREE! Web Vs App Development- Which one is Better?