Page 72 - PortGPT_V2.1_C6_Flipbook
P. 72

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.


                  70    Premium Edition-VI
   67   68   69   70   71   72   73   74   75   76   77