1.8 Flashcards

1
Q

What is a variable?

A

A variable is a named memory location that holds data that during the execution of a program, the data can change.

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

Define constant.

A

A constant is fixed data that during the execution of a program cannot change.

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

What is an operator?

A

An operator is a symbol used to instruct a computer to perform a specific operation on one or more values. E.g. arithmetic, comparison

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

What is a programming construct?

A

A programming construct determines the order in which lines of code are executed and controls the logic and behaviour of code.

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

The three core programming constructs are?

A

The three core programming constructs are sequence, selection, and iteration.

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

Define sequence

A

Sequence refers to lines of code which are run one line at a time in the order they are written from first to last.

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

What is selection?

A

Selection is when the flow of a program is changed depending on a set of conditions, determining which lines or block of code runs next.

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

What is casting?

A

Casting is when you convert one data type to another data type.

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

what does the % operator do

A

Gives the remainder of a division
10%3=1

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

what does the // operator do

A

gives the numbger of times the divider fits into the divided number
10//3=3

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

code to make things uppper and lowercase

A

var.upper() and var.lower()

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

code for lenghth of a string

A

len(var)

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

code for concatination

A

var1+var2

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