programming fundamentals Flashcards

1
Q

what is a sequence?

A

the specific order in which instructions are performed in an algorithm

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

what is a selection?

A

the process of making a decision eg a if statement

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

what is an iteration?

A

times when a program. needs to repeat certain steps until told otherwise, or until a condition has been me eg a loop.

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

what is MOD ?

A

% is the remainder when dividing

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

what is DIV?

A

// divides numbers to the nearest whole number. ignores remainders.

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

what is casting?

A

changing a data type. int()

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

what is concatenation?

A

obtaining a new string that contains both of the original strings. input()

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

what is slicing

A

the extraction of a part of a string or list

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

how to do file handling?

A

file= open(“file.txt”,”a”)
file.write(“what you want to write”)
file.close()

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

how to do random number generation?

A

random. randint(a, b)

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

how to find a random letter in a word?

A

fruit=”apple”
print(fruit[1])

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