1/48
topics covered: algorithms, python, micro:bit
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What are the inputs of a micro:bit?
Buttons, compass and accelerometer
What are the outputs of a micro:bit?
Speaker and LEDs
What is sequencing?
The concept that instructions are run in the order that they are written.
What is an interaction in python?
The concept in which you ask the user to enter an input to print statements.
What notation is used for an interacting input in phyton?
input()
If I want to ask for someone’s name using an input and store it in a variable called ‘name’. What is the code I should use?
name = input()
What does int() do to an interacting input?
Converts the input from a text input to an integer input.
What does float() do to an interacting input?
Converts the input from a text input to a decimal input.
If I wanted to ask someone for their favourite integer and store it in a variable called “integer”. How would I code it?
integer = int(input())
If I wanted to ask someone for their favourite decimal and store it in a variable called “decimal”. How would I code it?
decimal = float(input())
What notation is used for assignment?
=
What is assignment?
The act of storing a value in a variable.
What notation is used to compare a value to a variable?
==
What is a variable?
Containers that hold data in code; the data can change later during execution.
How is data assigned to a variable?
=
What is concatenation?
The act of linking strings and variables using +
How would you print the word: Hello?
print(“Hello”)
How would you print the variable Hello?
print(Hello)
How would you print the string Hello and the variable name1?
print(“Hello” + name1)
What is selection?
A construct that allows a choice to be made between different alternatives. That decision on what to do is decided by an input/interaction. Selection creates branches in a program and in python is represented with if/elif/else.
What 3 coding terms are used in selection?
if, elif, else
What comes first in the 3 selection coding terms?
if
What comes last in the 3 selection coding terms?
else
What comes in the middle of the 3 selection coding terms?
elif
What do you have to do to all code inside a selection term? (if/elif/else)
Indent it.
What case do the selection terms have to be in a program? (if/elif/else)
Lowercase.
What punctuation comes after a selection term?
A colon.
What has to be after an if or elif statement. (Not punctuation)
A comparison.
What syntax are used for comparisons?
==, <, >, <=, >= and !=
Comparison syntax: What does == mean?
Equal to
Comparison syntax: What does > mean?
Greater than
Comparison syntax: What does < mean?
Less than
Comparison syntax: What does <= mean?
Less than or equal to.
Comparison syntax: What does >= mean?
Greater than or equal to.
Comparison syntax: What does != mean?
Not equal to.
What is an algorithm?
An unambiguous (clear) sequence of instructions which must terminate and solve a problem or perform a task.
What are the features of an algorithm?
It is unambiguous
It must stop
It must solve a problem or perform a task
It must be performed in a certain order
What are the four standard flowchart shapes?
Oval, parallelogram, rectangle and diamond
How can an algorithm be presented?
Plain English
Flowchart
Pseudocode (blocks)
Code
What is the use of an oval in a flowchart?
It denotes the start/end of an algorithm
What is the use of an arrow in a flowchart?
It denotes the direction of the algorithm in which the sequence flows.
What is the use of a parallelogram in a flowchart?
It denotes an input/output.
What is the use of a rectangle in a flowchart?
It denotes a process.
What is the use of a diamond in a flowchart?
It denotes a decision.
What comes out of a diamond in a flowchart?
2 arrows labelled yes/no to denote a decision.
What is a dry run?
The process of executing an algorithm on pencil and paper to ensure it is functioning.
What is a trace table?
A method to record and work out variable values and outputs according to code with each column representing a variable/output and new row representing a change of value in a variable.
What is iteration?
The repetition of a section of an algorithm using a decision