Page 29 - CloudGPT_C6_Flipbook
P. 29

3                                                VARIABLES USING


                                                                               BLOCK CODING








                         Learning Outcomes

                      Introduction                                        What is Python?
                      What are Variables?                                 Naming Variables

                      Data Types                                          Performing Operations on Variables
                      Addition Operation using Block Coding





                 INTRODUCTION
                 In  the previous  chapters, you  have learnt the  basics of  algorithms, flowchart  and
                 pseudocodes. In this chapter, you are going to learn about another important component
                 of a program, variables.


                 WHAT IS PYTHON?
                 Python is a high  level object-oriented  programming language.  It is a general purpose
                 language with interactive features. Python is an open source software and is founded by

                 Guido Van Rossum in 1991. Python is extensively used in:
                   Web Development                     GUI Application Development                Data Analysis
                   Software Development                Scientific Applications


                 WHAT ARE VARIABLES?
                 Variable is a name given to a location in the memory, to store

                 values or data. For example, you must have seen your mother
                 naming boxes in the kitchen.  That box has a little storage
                 capacity and your mother gave it a name such as, salt, sugar,
                                                                                               SUGAR        SALT
                 tea, etc.
                 Variables are also similar to a box or a packet. These packets

                 can  be named,  referenced and  used  to perform various
                 mathematical operations.

                 So, a variable has a name (to refer to it), a type (kind of data it store and its size)
                 and a value (data). Usually variables are used to hold one or more values, result of
                 calculations, etc.



                                                                                 Variables Using  Block Coding   27
   24   25   26   27   28   29   30   31   32   33   34