Page 68 - PortGPT_V2.1_C6_Flipbook
P. 68

5                                 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
                                                                                                  SUGAR       SALT
                  naming boxes in the kitchen. That box has a little storage capacity
                  and your mother gave it a name such as, salt, sugar, 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.




                  66    Premium Edition-VI
   63   64   65   66   67   68   69   70   71   72   73