Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 80 - 2619_PlusGPT V2.1_C-8
P. 80

    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.  The  range  of  an  integer  can  be  from  -2147483648 to
                          2147483647.

                          Float: Float data types represent 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.

                           Sets

                      Set is a mutable, unordered collection of values, of any type, with no duplicate element.

                           Sequence

                      A sequence is an ordered collection of items of similar or different data types. The three types of
                      sequence data types are Strings, Lists and Tuples.
                            Strings: A string is a sequence of one or more characters put in single quotes, double quotes

                          or triple quotes which are used to represent text-based information. The quotes are not a
                          part of the string.

                          List: A list is a collection of data elements separated by comma(,) and enclosed within square
                          brackets. We can also create a list with the same or different data elements.

                           Boolean

                      Boolean is a data type with two built in values: True or False. They are used for logical evaluation.

                      A True statement returns value 1 while a False statement returns value 0.

                             COMMENTS IN PYTHON

                      Comments in Python can be used to explain parts of the code. It can also be used to hide the code as
                      well. Comments enable us to understand the way a program works. In Python, any statement starting
                      with # symbol is known as a comment. Python does not execute comments. Comments are not a part
                      of the program, but they do enhance the interactivity of the program and make it readable. Python
                      supports two types of comments: Single line comment and Multiline comment.

                      78    Premium Edition-VIII

| 75 76 77 78 79 80 81 82 83 84 85 |