Skip to main content
Skip to main content

Visual to text coding:
The Basics

Years 5-6; 7-8

This series of lessons is to help students to transition from visual coding to text-based coding with a general-purpose programming language.

This section provides the basics in order to use the programming environments: Scratch, Python and JavaScript.



   
Next lesson    


Learning map and outcomes

In this lesson, students will:

  1. Learn how to concatenate data for output
  2. Learn how to store data in variables
  3. Put these together to make a very basic weather application

The Basics

For information on setting up and choosing a language, see Setting up.

The following videos provide the basics for using general-purpose programming languages.


Concatenation

This video discusses the process of combining data together to form a coherent output.


Variables

Variables are like labelled containers for storing data. View the ‘Variables' video to learn more about how to create and use variables in your computer program.

Have students practise using variables. Interpret the following pseudocode and code it in Scratch and either Python or Javascript. Students should predict the output of the program (what it will display) before doing their code. Solution code is provided for checking.


BEGIN
    a ← 50
    Display a
    b ← 23
    Display b
    ca + b
    Display c
END

Solution code:


About input/ output

This video encourages users to build a simple weather application to consolidate knowledge learnt so far.

Resources

  • Setting up online environments
  • Online environments for coding in each language
    • Scratch
    • repl.it: an online environment suited to Python
    • JSFiddle: an online environment suited to JavaScript
  • Cheat sheets listing basic commands for coding:
    • Python Cheatsheet (from Grok Learning)
    • JavaScript CheatSheet (Tip: Press the little blue tabs to move Variables, Basics, Strings and Data Types to the top.)
   
Next lesson