Complete the Starter Activity in your Notebooks, you have 5 minutes.
Text
2. To know the differences between data types.
3. To understand the difference between assigning data and comparing data
A variable is a location of memory where we can store data.
Any word that comes before a single equals sign becomes a name that will refer to the data that follows.
L.O. 1: To fully understand variables and how to refer back to them later in your code
When we reference back to a variable, you must make sure that your spelling and grammar are exactly the same!
Otherwise, you will get a
SYNTAX ERROR
An IF statement can be used in Python to make a choice and run lines of code based on that choice.
However, there are certain rules that must be followed for it to run correctly.
L.O. 3: To understand the difference between assigning data and comparing data
For a comparison to be made, we must use two operator signs:
"==" - is equal to
"!=" - is not equal to
">=" - is greater than or equal to
"<=" - is less than or equal to
Any comparison must finish the line with a colon ":"
Otherwise, you will get a
SYNTAX ERROR
A string can only be compared to another string.
It CANNOT be compared to an integer or boolean!
In the same way an integer can only be compared to an integer and a float can only be compared to a float.
L.O. 2: To know the differences between data types.
Also, mathematical operators can only be applied to an integer/float and NOT a string!
Log into Grok Learning and continue your work on Python for Beginners
Complete the quiz in your Notebooks