Unit:8 Pseudocode and Python Flashcards

1
Q

In pseudo code how do u assign a variable?

A

Colour <— “red”

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

In python how do u assign a variable?

A

Colour = “red”

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

In pseudo code how do u output/input?

A

INPUT Colour
OUTPUT “The colour is “, Colour

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

In python how do u output/input?

A

Colour = input( )
Print (“The colour is”, colour)

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

In pseudo code how do u declare constants?

A

CONSTANT Colour <— “yellow”

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

In python how do u declare constants?

A

Colour_const. = “yellow”

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

In pseudo code what is the data type for text ?

A

Text or alphanumeric

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

In python what is the data type for text ?

A

String

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

In pseudo code what is the data type for whole numbers?

A

Integer

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

In python what is the data type for whole numbers?

A

Integer

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

In pseudo code what is the data type for a decimal?

A

Real

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

In python what is the data type for a decimal?

A

Float

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

In pseudo code what is the data type for true or false?

A

Boolean

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

In python what is the data type for true or false?

A

Boolean

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

How do you add numbers?

A

10 + 5

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

How do you subtract numbers?

17
Q

How do you multiply numbers?

18
Q

How do you divide numbers?

19
Q

How do you divide 2 numbers ignoring the decimals?

A

DIV (11, 2)
It gives 5

20
Q

How do you divide 2 numbers only showing the decimals?

A

MOD (11,2)
It gives 1

21
Q

How do you show powers of numbers?

22
Q

In python how do you write ‘not equal to’?

23
Q

How would you use an IF statement in pseudo code?

A

IF …………… THEN
…………………….
ENDIF

24
Q

How would you use an IF statement in python?

A

if ………… :
………………….

25
How would you use an IF, ELSE statement in pseudo code?
IF …………… THEN ……………………. ELSE ……………………. ENDIF
26
How would you use an IF, ELSE statement in python?
if ………….. : ……………. else : ……………
27
How would you use SELECT CASE in pseudo code?
CASE OF variable value1: value2: value3: OTHERWISE ENDCASE
28
How do you use Boolean operations in pseudo code?
IF …… x< 70 AND x >50
29
How do you use Boolean operations in python?
if …… x< 70 and x >50
30
What is a count controlled loop in pseudo code?
FOR x <— 1 TO 10 ……………… NEXT x
31
What is a count controlled loop in python?
for x in range (1,10) print (x)