1/52
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is a byte
8 bits
What is a nibble
4 bits
What is a bit
A binary digit, a 0 or a 1.
What does 1 mean in binary?
on
What does 0 mean in binary?
off
Binary system
a number system that has just two unique digits, 0 and 1, called bits
Define algorithm
A set of instructions for solving a problem
Define pseudocode
Pseudocode is a way of writing an algorithm in shorthand so that it is easy to understand
What is a variable?
A variable is a named value that can change when the program is run
What is a constant?
A Constant is a variable that dosen't change when a program is run
What is an integer?
A whole number that can be positive, negative, or zero
What is a string?
Used for text (eg ASCII, UNICODE characters)
What is a float?
In Python, use a float for positive or negative decimal numbers
What is a boolean?
True or False (used in code to detect whether something has happened or not)
What is a syntax error?
A syntax error is the incorrect use of a programming language element, such as a keyword, operator, or programmer-defined name.
What is a logical error?
Where a output is incorrect or unexpected
What is a procedure?
A Procedure is a named block of code which performs a task, but doesn't return a value back to the code which called it.
What is a function?
A Function is a named block of code which performs a task, and does return a value back to the code which called it. In Python a Function has to have the return keyword.
Count controlled loop
A loop that stops when a counter variable reaches a specified limit.
eg. for x in range (0,10):
print(x)
Condition controlled loop
Loop the program until a condition is satisfied.
eg. x=5
while x>=0:
print(x)
x = x -1
What is a linear search algorithm?
Goes through each item in list until the value is found.
Linear search alogrithm
Linear search algorthm pseudocode
input searchedForItem
found = false
For i = 0 to 7
If items[i] == searchedForItem
found = true
Output searchedForItem + " found at position" + i
End if
What is bubble sort?
This is a simple algorithm used for taking a list of unordered numbers and putting them into the correct order.
Multiply symbol python
Divide symbol python
/
To the power of symbol python
**
eg. 2**3 is 2x2x2
Whole number division symbol python
//
eg. 45//10 is 4
Modulo division symbol python
%
eg. 45%10 = 5
How are lists stored in python?
eg. certificate = ["U", "PG", "12A", "15", "18"]
How are items in lists numbered?
certificate = ["U", "PG", "12A", "15", "18"]
eg. "12A" is stored in location certificate[2]
How do you add something to a list?
eg. certificate.append("15")
How do you remove the last item in a list?
eg. certificate.pop()
What comes after if & else?
:
interger input
int(input("abcde"))
print("Hi")