Page 133 - Computer_Genius_v2.1_C7_flipbook
P. 133

Textual code











                             OUTPUT:








                 (b) User providing his own input.
                 Example: Asking for name.


                            Block Code








                           Textual code










                             OUTPUT:


                 Data Types
                 Every value needs to be assigned to a specific data type to make the variable more readable by a

                 computer.
                 Python has many data types built-in by default, some of them are:


                             Data Types           Block Based          Textual Code            Example

                               Integer                                                      -1, -2, 0, 1, 13


                                Float                                                        0.33, 2.5, 3.9


                              Boolean                                                         True, False


                               String                                                        “Hi Coder!”




                                                                                             Textual Coding   131
   128   129   130   131   132   133   134   135   136   137   138