Page 112 - 2606_PlugGPT_C7_Flipbook
P. 112

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 two 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.


                  Integer/Long

                  Integers are whole numbers consisting of + or – signs. They do not have decimal places between
                  them. For example, 87, -3 are called integer numbers.




                          uiz    Bee       What is the use of the AND operator in Python?
                                           _________________________________________________________________







                  Float
                  Float data type represents numbers that contain a decimal point. For example, 0.6, -3.257 are
                  called floating-point numbers. These numbers can also be written using ‘e’ or ‘E’ to represent the
                  power 10.






                  110   Premium Edition-VII
   107   108   109   110   111   112   113   114   115   116   117