WorksheetsSHS 8.4 Python
Total questions: 23
Worksheet time: 8mins
Notes in programs that the complier/interpreter ignore. In Python you write these using #
Variable
Comments
While
String
A space in memory to store some information that can be used later on in a program. This stored information can change.
Iteration
while
Variable
for
Categories that define what a variable can store e.g. Int, Str, Bool
Boolean
Data types
Float
String
A category of variable combining letters and or numbers e.g. "ABCD" "Hello World 123"
Concatenation
String
Mathematical operator
Conditional statement
A category of variable that stores whole numbers
Float
Input command
String
Integer or Int
A category of variable for storing decimal numbers e.g. 1.2, 3.142, 0.673
While
Float
Variable
For
A category of variable for storing true/false values
if statement
Boolean
Assignment operators
String
A category of variable for storing multiple pieces of information in one variable.
List
Concatenation
Logic error
While
This means to change a variables category e.g. changing int(123) to float(123.0)
String
Variable
Cast/Casting
Comments
A way to get information into the computer when programming
Iteration
Input command
While
Output command
A way to get information out of the computer when programming
Concatenation
Float
Data type
Output command
To link or join things together. Like "gluing" strings together e.g. "Top" + "Hat" becomes "TopHat"
Concatenation
Variable
Iteration
While
A function that can be performed on integers or floats. For example + - * / %
for
Mathematical operators
While
Iteration
Used to assign values to variables e.g. =, +=, -=
Assignment operators
String
Iteration
For
An statement that performs an action on the result of an operation. It can be thought of as yes/no, true/false
Comments
Conditional statements
Variable
Iteration
How we deal with a conditional statement. For example: if rainingOutside = "yes" print("Take umbrella")
Variable
List
if elif else
Boolean
Used with conditional statements if, elif, and else as all can result in true or false. e.g. ==, !=, >, <, >=, <=
Comparison operators
Iteration
for
While
Used to combine conditional statements so they resolve to a single true or false statement e.g. AND OR NOT
Logical operators
Cast/Casting
Input command
Data types
Means to do the same process over and over again in a loop
Iteration
Concatentation
Boolean
List
A type of loop used in programming when we know how many times we want to iterate
for
while
String
float
A type of loop used in programming when we do not know how many times we want to loop
while
for
Input command
Assignment operator
A error in the written code. Like a spelling or grammatical error when writing a sentence.
Syntax error
Iteration
String
Variable
When the code runs, but does not do what you expect. These kind of errors are harder to fix.
Logic error
Syntax error
Conditional statements
Comparison operator
