Part2- Python Fundamentals | Start from the basics
If u fell any difficulty in watching the content, try to reduce the size of this page or rotate your portable device if you are using it
In the previous article, we have learnt about Python Character Set and the definition of Tokens.
In today's blog we shall learn about different types of tokens one-by-one. So let's start : )
- Python has the following tokens:
Python programming language contains the following keyword:
2. Identifiers (Names): Identifiers are fundamental building blocks of a program & are used as the general terminology for the names given to different parts of the program viz. variables, objects, classes, functions, lists, dictionaries, etc.
Identifier forming rules of Python are being specified below:
- An identifier is an arbitrarily long sequence of letters & digits.
- The first character must be a letter, the underscore ( _ ) counts as a letter.
- Upper & lower-case letters are different. All characters are significant.
- The digits 0 through 9 can be the part of the identifier except for the first character.
- Identifiers are unlimited in length. Case is significant i.e. Python is case sensitive as it treats upper & lower-case characters differently.
- An identifier must not be a keyword of python.
- An identifier cannot contain any special character except for underscore ( _ ).
Myfile DATE_7_77 DATA-REC contains special character - - (hyphen)
MYFILE _DS 29CLCT starting with a digit
CHK FILE13 break reserved keyword
Z2T0Z9 _ HJI3_JK My.file contains special character .(dot)
3. Literals/Values: Literals (often referred to as constant Values) are data items that have a fixed value. Python allows several kinds of literals:
We shall learn about the types of literals in the next article.
No comments