7/CS Lent term

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/48

flashcard set

Earn XP

Description and Tags

topics covered: algorithms, python, micro:bit

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

49 Terms

1
New cards

What are the inputs of a micro:bit?

Buttons, compass and accelerometer

2
New cards

What are the outputs of a micro:bit?

Speaker and LEDs

3
New cards

What is sequencing?

The concept that instructions are run in the order that they are written.

4
New cards

What is an interaction in python?

The concept in which you ask the user to enter an input to print statements.

5
New cards

What notation is used for an interacting input in phyton?

input()

6
New cards

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()

7
New cards

What does int() do to an interacting input?

Converts the input from a text input to an integer input.

8
New cards

What does float() do to an interacting input?

Converts the input from a text input to a decimal input.

9
New cards

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())

10
New cards

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())

11
New cards

What notation is used for assignment?

=

12
New cards

What is assignment?

The act of storing a value in a variable.

13
New cards

What notation is used to compare a value to a variable?

==

14
New cards

What is a variable?

Containers that hold data in code; the data can change later during execution.

15
New cards

How is data assigned to a variable?

=

16
New cards

What is concatenation?

The act of linking strings and variables using +

17
New cards

How would you print the word: Hello?

print(“Hello”)

18
New cards

How would you print the variable Hello?

print(Hello)

19
New cards

How would you print the string Hello and the variable name1?

print(“Hello” + name1)

20
New cards

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.

21
New cards

What 3 coding terms are used in selection?

if, elif, else

22
New cards

What comes first in the 3 selection coding terms?

if

23
New cards

What comes last in the 3 selection coding terms?

else

24
New cards

What comes in the middle of the 3 selection coding terms?

elif

25
New cards

What do you have to do to all code inside a selection term? (if/elif/else)

Indent it.

26
New cards

What case do the selection terms have to be in a program? (if/elif/else)

Lowercase.

27
New cards

What punctuation comes after a selection term?

A colon.

28
New cards

What has to be after an if or elif statement. (Not punctuation)

A comparison.

29
New cards

What syntax are used for comparisons?

==, <, >, <=, >= and !=

30
New cards

Comparison syntax: What does == mean?

Equal to

31
New cards

Comparison syntax: What does > mean?

Greater than

32
New cards

Comparison syntax: What does < mean?

Less than

33
New cards

Comparison syntax: What does <= mean?

Less than or equal to.

34
New cards

Comparison syntax: What does >= mean?

Greater than or equal to.

35
New cards

Comparison syntax: What does != mean?

Not equal to.

36
New cards

What is an algorithm?

An unambiguous (clear) sequence of instructions which must terminate and solve a problem or perform a task.

37
New cards

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

38
New cards

What are the four standard flowchart shapes?

Oval, parallelogram, rectangle and diamond

39
New cards

How can an algorithm be presented?

  • Plain English

  • Flowchart

  • Pseudocode (blocks)

  • Code

40
New cards

What is the use of an oval in a flowchart?

It denotes the start/end of an algorithm

41
New cards

What is the use of an arrow in a flowchart?

It denotes the direction of the algorithm in which the sequence flows.

42
New cards

What is the use of a parallelogram in a flowchart?

It denotes an input/output.

43
New cards

What is the use of a rectangle in a flowchart?

It denotes a process.

44
New cards

What is the use of a diamond in a flowchart?

It denotes a decision.

45
New cards

What comes out of a diamond in a flowchart?

2 arrows labelled yes/no to denote a decision.

46
New cards

What is a dry run?

The process of executing an algorithm on pencil and paper to ensure it is functioning.

47
New cards

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.

48
New cards

What is iteration?

The repetition of a section of an algorithm using a decision

49
New cards