Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

11

Lesson Tasks

  • Watch the Lesson video
    Make notes if needed.
  • Open your Learning Journal
    Complete Task 1 in your Learning Journal
  • Complete the learning activities
    Make sure you complete the book tasks in your Unit Booklet
  • Complete End of Task Assessment
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to understand and know how to use a variable and constant declaration in a computer program.
I need to learn how to understand why I should use a variable and constant declaration in a computer program.
I need to learn how to understand and know how to use assignment in a computer program.
I need to learn how to use meaningful identifier names and know why it is important to use them.

Key Terms

High level languages Assignment operator Assigned value Snake case Camel case Variable Constant

Task 1 - Getting organised Click to see more


Task: Learning Journal

Open your Learning Journal by clicking on the image below

Good notes will help you organise and process data and information

Task 1: Fill out your learning Journal.

Open your Learning Journal and complete the task below .


Task 2 - Imperative Languages Click to see more

  • Go to R10 Imperative Languages to find out more information. Then complete the slide shown below in your Learning Journal


  • Task 2:

    Open your Learning Journal and complete the task below .



    Task 3 - Constants and Variables Click to see more

    A variable stores data that can change while a program is running.

    A Constant stores data that cannot change while a program is running.

    In Python We don't need to define a variable or constant before using it. We simply assign it a value and it will exist. We don't even have to declare the type of the variable. This is handled internally according to the type of value we assign to the variable

    Variable assignment - Assigning value to a Variable in Python

    We use the assignment operator (=) to assign values to a variable. Any type of value can be assigned to any valid variable.

    Assignment Example

    a = 7
    b = 3.14
    c = "Hello World"

    Click on the run button below to see the output of the python code assigning variables

    See if you can improve the output of the code above?


    Task: Variables

    Open your student workbook at page 12 and then complete Task 4 .

    A Constant is a value that cannot change while a program is running

    Task: Constants

    Open your student workbook at page 14 and then complete Task 5 .


    Task 3:

    Open your Learning Journal and complete the task below .



    Task 4 - Naming Conventions Click to see more

    When creating identifiers to identify a constant or a variable there are certain naming conventions we need to be aware of.

    Here are naming conventions for Python identifiers −

    • Class names start with an uppercase letter. All other identifiers start with a lowercase letter
    • Starting an identifier with a single leading underscore indicates that the identifier is private
    • Starting an identifier with two leading underscores indicates a strongly private identifier
    • If the identifier also ends with two trailing underscores, the identifier is a language-defined special name

    Python does not allow punctuation characters such as @, $, and % within identifiers. Python is a case sensitive programming language. Thus, Manpower and manpower are two different identifiers in Python.

    Task 4: Naming conventions

    Open your student workbook at page 14 read through the rules for naming constants and variables. Then write a summary of the rules in your Learning Journal See slide Below.




    Task 5 - Defining Variables and constants Click to see more

    Task: Assignment

    Open your student workbook at page 13 read the notes and then complete Tasks 6 & 7 .


    Task 6 - Lesson Review Click to see more


    Summing it all up

    Lets look at the learning outcomes and decide which one best describes our current level of understanding :

    Tick the one you feel is closest to your level

    Learning Outcomes I need to learn how to understand and know how to use a variable and constant declaration in a computer program.

    • I have a basic understanding of how I can understand and know how to use a variable and constant declaration in a computer program. with a little help from my teacher
    • I can show my teacher that I can understand and know how to use a variable and constant declaration in a computer program. without their help.
    • I can understand and know how to use a variable and constant declaration in a computer program. independently and I can also explain it to others and can complete any extension tasks I am given.

    🠜 Now update your learning objectivesClick on the Assessment image

    Task 7 - Homework Click to see more


    Complete any unfinished tasks