Page 191 - AI Ver 1.0 Class 10
P. 191

9
                    >>>a="orange"
                    >>>a
                    ‘orange’
                 There are different ways of assigning values to different variables in Python:

                    • Method 1: Assigning different values to different variable on different lines. For example:








                    • Method 2: Assigning different values to different variable on same line. For example:








                                                                   OR







                    • Method 3: Assigning same values to different variables on same line. For example:








                 Data Types

                 Data types specify the kind of a value a variable can store. It helps us to identify the kind of operation that can
                 be performed on that specific data type. Every value in Python has a datatype.


                                                                Data Types



                                   Numbers          None        Sequences       Boolean       Sets     Maps



                             int      float     complex      string     list      tuple              Dictionary

                 Let us study about some of the standard built-in data types of Python.


                 Numbers
                 Data with a numeric value falls into this category. It can be integer, float and complex. Python will automatically
                 convert a number from one type to another if needed. Below are the data types to classify numbered data:
                    • int: Integers are whole numbers (+ve, -ve or 0) with no fractions or decimal value. Its length is dependent on
                   the available memory. For example: 10,124,4567,7812568751.



                                                                                           Advance Python   189
   186   187   188   189   190   191   192   193   194   195   196