Page 67 - DK Children's Encyclopedia
P. 67

Coding                                                                            SEE ALSO

                                                                                               ▸ ▸ Codes  p.66–67
                                                                                               ▸ ▸ Communication
           Computers follow instructions from special programs.                                 p.69
           These instructions are known as code, and writing                                   ▸ ▸ Computers  p.71
           them is called coding. Code can be written in many                                  ▸ ▸ Internet  p.138

           different coding languages.                                                         ▸ ▸ Language  p.144
                                                                                               ▸ ▸ School
                                                                                                pp.272–273

       Computer languages
       Programming languages tell
       computers what to do. This
       example shows a text-based
       language called Python.









        Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016,   Hello World!
        10:47:25)
        [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on
        Darwin
        Type “copyright”, “credits” or “license()” for
        more information.
        >>>
                                                                                                The first
        print ( ‘Hello World!’)
                                                                                            programmer was
                                                                                              Lady Ada
                                                                                              Lovelace
                                                                                              (1815–1852).
       Input                            Output
       Instructions are typed into a text   When the program is run, it follows the
       window. These instructions tell the   typed instructions. Here, the computer
       computer to show, “Hello World!”  screen shows, “Hello World!”


       Learning to code
       Some computer
       languages are easier
       to learn than others.
       Scratch uses colorful
       blocks of code that you
       can arrange to make your
       own games.


           Output                                                                                       Input
           The blocks control                                                                           In Scratch,
           the actions of the                                                                           coding is done by
           characters here, on                                                                          putting together
           the “Stage.”                                                                                 instruction blocks.



                                                             65





   US_065_Coding.indd   65                                                                                       16/05/2017   09:46
   62   63   64   65   66   67   68   69   70   71   72