Page 85 - KEC Khaitan C7 Flipbook
P. 85

TOKENS AND DATA                                                                          CHAPTER


                 TYPES IN PYTHON                                                                         B1

















                    Topics Covered


                   The student will be able to:
                       recognise Python's character set and tokens.
                       work with different data types and arithmetic operators.
                       identify and fix common Python errors.






                           PYTHON CHARACTER SET

                 A set of valid characters recognised by a language is called a character set. The characters used
                 in the Python source program belong to the Unicode standard. The characters in Python are
                 grouped into the following categories:

                   Alphabet:  A to Z (uppercase), a to z (lowercase)
                   Digits: 0 to 9

                   Special characters (:) colon ( ) + _- * / /\ ^ & % # $ {} []! _(underscore) >< ?@ , ; etc. (white space,
                   blank space, horizontal tab ( ), carriage return, new line, form feed)
                 Python can process any of the ASCII and Unicode characters as data or as literals.



                           PYTHON TOKENS

                 A token is the smallest element of a Python program that is meaningful to the interpreter. You
                 have learned about some tokens in the previous class. Now learn more about them in detail.



                                                          PYTHON TOKENS






                   IDENTIFIERS         KEYWORDS            CONSTANTS           OPERATORS           PUNCTUATORS





                                                                                    Tokens and Data Types in Python  83
   80   81   82   83   84   85   86   87   88   89   90