Page 118 - CG_v2.1_flipBooks_class_5
P. 118

Float (float)

                  Floats are numbers that are written with a decimal point in them.
                  For example: 3.4, -432.6, 3.14, 0.5, 4.0, etc. We can show an approximate result using float
                  numbers.

                  Boolean (bool)

                  Boolean kind of variables have only two values: True or False.
                  We can verify any kind of statement or condition in a code using a Boolean command. We can
                  give our code a direction as it can be programmed to act differently for different outcomes.
                  Users can check for conditions and let the code to act automatically.

                  String (str)

                  Strings are a sequence of one or multiple characters like alphabets, numbers or symbols.
                  They can be used to declare names, addresses or descriptions of variables. Any character
                  or set of characters under quotation marks is considered as 'Strings'.
                  For example: 'ball', 'good luck', '456', 'c@de', '3563apple', etc.

                  Input Blocks in AI Connect

                  Input blocks are used to add value to a variable and modify the code.

                  There are input blocks for adding values in all four data types— int, float, str and bool. Let’s
                  look at the blocks to find more about them:

                                                  This block inputs a string value as a question in the block and
                                                  prompts the user to enter an answer in the box when they
                                                  run the program. The code waits until an answer is entered.
                                                  This block also inputs string values in the code. Just enter
                                                  any statement in the space given in the block.

                                                  This  is a  numeric  input  block  that  takes  integers  and
                                                  float  numbers  as  inputs.  They  are  very  useful  for  taking
                                                  measurements and using maths.

                                                  This input block adds Boolean value to a code. It can declare
                                                  a variable or statement either  true or false.

                  Output Block and Commands

                  With  output  block  palette  you  can  structure  the  appearance  of  your  output,  there  are
                  3 blocks under this category. They are 'print', 'print separated by', and 'print end with'.






                  ‘Print’ is an output command that’s used to print anything that is attached to it on the screen.

                  It can be used to display answers, calculations, descriptions and instructions for users.


                      116    Computer Genius (V2.1)-V
   113   114   115   116   117   118   119   120   121   122   123