MT2 Flashcards

1
Q

What do arrays use?

A

Square brackets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the five data types?

A

Integer
Boolean
Real (float)
Character
String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Syntax error?

A

It is an error that occurs when the interpreter shows an invalid syntax on executing the python code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When do you use a fixed loop?

A

When you know in advance how many times you want to repeat a block of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are fixed loops also known as?

A

‘For’ loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When are conditional loops used?

A

When you want to repeat a block of code until a specific condition is met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are conditional loops also known as?

A

‘While’ loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an input?

A

It is what you enter into the program for the program to use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an output?

A

It is what the program prints onto the screen at the final stage of the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a process?

A

A process is the equation that the program has to do before it prints the final answer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is concatenation?

A

It is the process of combining or joining two or more strings to create a new string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a simple condition?

A

It is a condition which evaluates whether a statement is true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does a complex condition involve?

A

It involves multiple comparisons or checks combined using logical operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are logic errors?

A

Errors that occur due to flawed logic in the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are indentation errors?

A

errors that occurs when tabs or spaces in a code do not follow expected patterns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Name and describe the 1 data structure we need to know.

A

Array, and it stores more than one value to a variable for efficiency

17
Q

what are the four ways of making code readable?

A

-white space
-indentation
-internal commentary
-meaningful variable names

18
Q

what does white space do?

A

it seperates sections of code with blank lines to make it easier to read

19
Q

what does indentation do?

A

indentation is essential for Python to run, using indentation shows what is happening at different steps of a loop

20
Q

what does internal commentary do?

A

Tells the reader what is going on in the code using hashtags

21
Q

what does meaningful variable names do?

A

ensures variables are called names that describe the data they hold

22
Q

what are the 3 design notations?

A

-structure diagram
-flowchart
-pseudocode