Page 17 - Modular v1.1 Pyhton
P. 17

02                         DATA TYPES AND



                                                                    OPERATORS IN PYTHON















                         Your Aim

                         to learn about:
                                  Data Types                                 Comments in Python
                                    Operators                                  Precedence of Operators
                                     Some More Programs




                 In the previous chapter, you have learned what is Python, its features, how to install Python,
                 programming in Python and variable.

                 In this chapter, you will learn about data types, comments, operators and its precedence.


                     DATA TYPES

                 Data types are used to define the type of value a data can contain. Each variable in Python is associated
                 with some data type. Each data type requires a different amount of memory and has some specific
                 operations performed on it.  Data types are divided into four categories as shown below:


                                                                   Data Types




                                   Numbers                   Sets             Sequence                Boolean





                     Integer/long                Float               String                  Lists




                                   Complex                                       Tuple

                 Number


                 Integer numbers, floating-point numbers, and complex numbers are the built-in numeric data
                 types of Python.


                                                                            Data Types and Operators in Python    15
   12   13   14   15   16   17   18   19   20   21   22