MT2 Flashcards
What do arrays use?
Square brackets
What are the five data types?
Integer
Boolean
Real (float)
Character
String
What is a Syntax error?
It is an error that occurs when the interpreter shows an invalid syntax on executing the python code
When do you use a fixed loop?
When you know in advance how many times you want to repeat a block of code
What are fixed loops also known as?
‘For’ loop
When are conditional loops used?
When you want to repeat a block of code until a specific condition is met
What are conditional loops also known as?
‘While’ loop
What is an input?
It is what you enter into the program for the program to use
What is an output?
It is what the program prints onto the screen at the final stage of the code
What is a process?
A process is the equation that the program has to do before it prints the final answer
What is concatenation?
It is the process of combining or joining two or more strings to create a new string
What is a simple condition?
It is a condition which evaluates whether a statement is true or false
What does a complex condition involve?
It involves multiple comparisons or checks combined using logical operators
what are logic errors?
Errors that occur due to flawed logic in the code
what are indentation errors?
errors that occurs when tabs or spaces in a code do not follow expected patterns.
Name and describe the 1 data structure we need to know.
Array, and it stores more than one value to a variable for efficiency
what are the four ways of making code readable?
-white space
-indentation
-internal commentary
-meaningful variable names
what does white space do?
it seperates sections of code with blank lines to make it easier to read
what does indentation do?
indentation is essential for Python to run, using indentation shows what is happening at different steps of a loop
what does internal commentary do?
Tells the reader what is going on in the code using hashtags
what does meaningful variable names do?
ensures variables are called names that describe the data they hold
what are the 3 design notations?
-structure diagram
-flowchart
-pseudocode