top of page
Search

Python Keywords and Identifiers: What's the Difference?

  • Writer: Minu k
    Minu k
  • Jun 9, 2022
  • 2 min read




Keywords


Keywords are words that have been designated as having a specific meaning. Identifiers are the names given to variables, functions, and other objects by the user. Except for True, False, and None, they are all written in lower case. It is not necessary to write in lowercase.


In Python, keywords are predefined collections of words that are used to accomplish a given function or purpose. The python syntax includes these keywords. The majority of them serve a purpose that is pretty comparable to their English meaning. This makes python simple to learn and code.


Keywords, like built-in functions, are likewise built-in. However, unlike other built-in functions, they are unable to change their purpose or naming convention.



  • It starts with a lower case letter every time.


  • They are pre-defined words that are only used with software.


  • They can't be used in any other situation.


  • Only alphabetical characters are allowed.


  • It aids in the identification of specific properties inside a language.


  • There are some symbols or punctuation marks that are utilized.




Identifiers



Variables, classes, functions, and other entities are assigned names called identifiers. It aids in the distinction of one entity from another and the comprehension of the flow of entities in code.



The identifier is made up of characters, digits, and the underscore sign. For multi-word variables like count one, container 2, and so on, underscore can be used.



  • Python is a case-sensitive programming language with case-sensitive identifiers.

  • To make the code more intelligible, it is recommended that the identifier be given a meaningful name.

  • A variable, a function, a class, a structure, and a union are all named employing them.

  • It is designed to give an entity a unique name.

  • They can be comprised of alphabets, numbers, or underscores.

  • With the exception of the underscore, there are no punctuation marks or special symbols.

  • It can be expressed in upper or lower case.

  • It supports in the identification of the entity's name, which is defined alongside a keyword.


Conclusion

Here, we discussed about in details about keywords and identifiers in python. Learned about all keywords in python are in lowercase .

 
 
 

Comments


learnskill123

©2022 by learnskill123. Proudly created with Wix.com

bottom of page