Python - SPLessons

Python Identifiers and Literals

Home > Lesson > Chapter 5
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Python Identifiers and Literals

Python Identifiers and Literals

shape Description

The python is a case sensitive language and identifiers are nothing but giving special names will be given to programming blocks. Except underscore(_) nothing is an identifier. All the keywords are not identifiers. literals are only information will be given to constants or factors. The literals can be characterized as takes after. No unique character with the exception of underscore ( _ ) can be utilized as an identifier.

Literals

shape Description

literals are only information will be given to constants or factors. The literals can be characterized as takes after. The following are the types of literals in python.

String literals

String literals can be framed by encasing a content in the quotes. One can utilize both single and additionally two fold quotes for a String. The following is an example. [c]"splessons" , '123456'[/c] There are two sorts of Strings bolstered in Python. The Single line String-Strings that are ended inside a solitary line are known as Single line Strings. The following is an example. [c]>>> text1='hello world' [/c]

Numeric literals

Numeric Literals are permanent. Numeric literals can have a place with taking after four diverse numerical sorts.

Boolean literals

A Boolean exacting can have any of the two esteem false or true.

Special literals

None is utilized to determine to that handle that is not made. It is likewise utilized for end of records as a part of Python. Accumulations, for example, tuples, records and Dictionary are utilized as a part of Python. The following is an example for multi line String. [c]>>> text1='hello\ user' >>> text1 'hellouser' >>> [/c] The following is an example for adding black slash at the end of each line. [c]>>> text1='hello\ user' >>> text1 'hellouser' >>> [/c]

Summary

shape Key Points

  • Tuples, lists, dictionary all are the types of collections.
  • Lists are mutable that means they are changable.
  • The underscore is the special identifier placed.
  • The tuple is a form to store the data of different types.