Page 33 - CloudGPT_C8_Flipbook
P. 33

Output 'Integer a = ' & a
                 Output 'Float b = ' & b
                 Output 'Char d = ' & d
                 Output 'String e = ' & e
                 Output 'Boolean f = ' & f

                 Program End
                 Note: In Python, there is no command to declare variables. In this variable is created when

                 you assign a value to it and the data type of the variable can be assigned by using typecasting.
                 Typecasting refers to convert the variable data type into another data type.

                                                                                                      Subject Enrichment
                   Example 2:  b=8
                                 C= 'Hello'
                                 y = int(6)   //y will be saved as 6



                                          Coding fact


                   NASA is the most popular space research agency, yet it is using codes from 70's.


                   Coding           uiz   02

                                                                                                      Subject Enrichment
                    Fill in the blanks.

                    a.  ............... identifies the type of data which the declared variable can hold.

                    b.  ............... is used to store whole numbers.




                 PERFORMING OPERATIONS ON VARIABLES
                 Variable is a storage area, which defines the size, layout, range set of operations to be

                 performed on variable.
                 Once you declare the data types, you will learn to perform the operations on the data types.

                    Operator: It is a symbol which operates on a value assigned to a variable. Example: +,-, *, \.
                    Operand: It is a value on which the operator performed operation.

                 Arithmetic operators

                 Arithmetic operation combines two or more numeric expressions by using the arithmetic
                 operators. The  arithmetic  operators perform  operations  such  as: addition,  subtraction,
                 multiplication,  division,  and  modulus.  In  the  table given  below,  we  are taking,  value  of

                 variable a= 10, and of b=30.
                                                                                 Variables Using  Block Coding   31
   28   29   30   31   32   33   34   35   36   37   38