Code Flashcards
What is a syntax error?
A grammatical fault in the code such as improper use of indentation neglecting to include required symbols (e.g. a colon).
What is indentation commonly used for?
Indentation improve the readability of code, allowing the programmer to differentiate between various blocks (e.g. functions, loops and classes).
What is a function?
A block of code that can accept additional information in the form of additional arguments ( passed within brackets)
What is a variable?
A piece of data that can be assigned a value and can be altered in code.
What is the assignment operator?
=
What does an assignment operator do?
It assigns a value to a variable such as a number or a string.
What symbol is used to check if 2 variables are equal or if a variable is equal to a value?
==
What symbol is used to check if a variable is equal to or greater than a variable or a value?
> =
What symbol is used to check if a variable is equal to or less than a variable or a value?
<=
What is used in an if statement to make it only activate if multiple conditions are all met?
AND
What is used in an if statement to make it activate if any listed condition is met?
OR
What is triggered if an if statement is not met?
else
What must go after each conditional statement?
if, else, while etc
:
What is a string?
A set of alphanumeric characters that have no mathematical value therefore cannot be used in equations.
What is an integer?
A whole number