BASICS OF PYTHON

                              BASICS OF PYTHON 

Python basics like tokens, character set, expressions, statement, input and output.

CHARACTER SET 

A set of valid characters that a language can recognize. A Character represents any digit, letter or any other symbol. And python supports Unicode encoding standard.

  letters = A - Z , a - z
  digits = 0 - 9
  special symbol = space + -  / [ ] { } # * '  ''  ''' <=   >= != @ ( ) 
                               ** _(underscore)
  whitespaces = blank space, tabs , carriage return, newline,                                  formfeed
   Other characters = all ASCII and Unicode characters as data.

TOKENS 

the smallest individual unit in a program is called a token or lexical unit or lexical element.
 they are sub divided into five parts 
1) keywords 
2) identifiers
3) literals 
4) operators
5) punctuators 

keywords - that convey a special meaning to the language compiler or interpreter. these are reserved for special purpose and must not be used as normal identifier names.
 Examples - false, true, if, else, elif, del, from, while, and, continue,                     except, def, import, not,  break, assert etc.

identifiers - identifiers are the building blocks of a program and are used as the general terminology for the names given to different parts of the program. variables, objects, classes, functions, lists, dictionaries etc.
--following rules for identifiers 
1) sequence of letters and digits
2) first character must be a letter and underscore count as letter.
3) all characters are significant and are case sensitive and executes differently upper case and lower case.

valid identifiers
MYFILE
myfile
_myso
_23fo






BASICS OF PYTHON  BASICS OF PYTHON  Reviewed by Hack on August 27, 2019 Rating: 5

No comments:

Powered by Blogger.