Page 131 - Computer_Genius_v2.1_C7_flipbook
P. 131

Block coding is the basic form of computers programming and a great way to start learning coding.
                 Block based coding consists of easy to use block based interface. With block code one can learn the
                 programming logic and design better.

                 Text-based coding involves writing lines of code. It should be introduced when one got used to block
                 based coding. It is essentially typing instructions in a programming language with a syntax.
                 Syntax is the set of rules for writing a programming language. It is like the spelling and grammar of
                 the language that define its structure.

                 We have to follow the syntax carefully while writing the textual code. Let us understand it in AI
                 Connect.

                 Basics of Textual Coding

                 To start with the textual coding, you should have a clear understanding of the following coding
                 concepts:

                 Print Command

                 The print() function prints the specified message to the screen, or other standard output device.
                 Also, the print command can be used to provide the information anywhere in the code.

                 It is very useful to know the status of your code.
                 Syntax: print(message/value)

                 For example,
                     print(‘I Love Coding’)

                 Usage: To print the output.

                            Block Code








                           Textual code











                                                               Notes


                        To print the value of a variable, we do not need to add it in double quotes. Whereas,
                        to print a message on the screen, we need to enclose them in double quotes.






                                                                                             Textual Coding   129
   126   127   128   129   130   131   132   133   134   135   136