2.1 Introduction to Python 24/25 Flashcards
Year 10 Autumn 2
What is a syntax error?
When the rules of grammar of the programming language have been broken.
What is a logic error?
When a program is able to run but does something unexpected.
Which part of the IDE identifies errors?
The Error Diagnostic will locate and identify the syntax error in the code.
Which type of errors does the Error Diagnostic identify?
The Error Diagnostic locates syntax errors, e.g. errors in the structure of the code.
Describe how an insertion sort is carried out.
An insertion sort is where the numbers are inserted into the correct position. It is the quickest kind of sorting.
Describe how a merge sort is carried out.
A merge sort is where we divide and conquer - octo (8) - quads (4) - pairs (2) then sort pairs (2) - quads (4) - octo (8).
Describe how bubble sort is carried out.
After the first pass, the largest item is in the correct place. After the second pass, the largest two items are in the correct place etc. etc. until after the final pass, only two items need to be sorted.
Describe how a linear search is carried out.
A linear search is where each item in the list is checked until the correct item is found. This can be a slow process if the list is long.
Describe how a binary search is carried out.
A binary search is where the list is divided in 2 - is the item you are looking for in the top half or bottom half - get rid of the half of the list it is not in, and repeat the process until you find the item you are looking for.
What is a variable?
A location in memory that stores one item. A variable can change as the program runs.
What is a constant?
A location in memory that stores one item. A constant cannot change as the program runs.
What is an input statement?
An input statement allows the user to interact with the program.
How would an input statement appear in an exam question?
The program asks the user to… - variableName = input(“Statement”)
What is an output statement?
An output statement will display the processed information.
How would an output statement appear in an exam question?
The program outputs the … - print (“output”) or print(variableName)