Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 98 - 2615_KEC
P. 98

    TOKENS AND DATA                                                                        CHAPTER

                      TYPES IN PYTHON                                                                       B2

                         Learning Outcomes

                         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

                       96   Premium Edition-VII

| 93 94 95 96 97 98 99 100 101 102 103 |