Unit:8 Pseudocode and Python Flashcards

You may prefer our related Brainscape-certified 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?

A

10 - 2

17
Q

How do you multiply numbers?

A

10 * 2

18
Q

How do you divide numbers?

A

10 / 2

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?

A

10^2

22
Q

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

A

!=

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
Q

How would you use an IF, ELSE statement in pseudo code?

A

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

26
Q

How would you use an IF, ELSE statement in python?

A

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

27
Q

How would you use SELECT CASE in pseudo code?

A

CASE OF variable
value1:
value2:
value3:
OTHERWISE
ENDCASE

28
Q

How do you use Boolean operations in pseudo code?

A

IF …… x< 70 AND x >50

29
Q

How do you use Boolean operations in python?

A

if …… x< 70 and x >50

30
Q

What is a count controlled loop in pseudo code?

A

FOR x <— 1 TO 10
………………
NEXT x

31
Q

What is a count controlled loop in python?

A

for x in range (1,10)
print (x)