Leaving Cert Notes

Notes and Anki Decks for the Leaving Cert

Variables

There are values that can change

Example: temperature in the room every ten seconds

Fixed Variables:

x = 4
y = 6
print(x+y)
Output:
10

Variable Naming Convention

We have 3 temperature probes

Naming System 1:

Naming System 2:

Naming System 3:

Naming System 4:

Rules of Variables:

  1. Variables can’t start with a number
  2. No spaces in variables (Use underscores (_) )
  3. No using special characters

    E.g: @, !, #, etc.

  4. It is possible but you should never use python commands as variable names

Numerical Variables

Name Function Description Example
Integer int Positive Whole Numbers 10
Float float Decimal Numbers 8.37
String str A collection of characters “John”
Boolean bool True/False True