computer science Flashcards

(30 cards)

1
Q

what are the 5 primitive data types in python?

A

integer, float/real, character, boolean and string

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

what does an integer data type store

A

whole numbers

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

what do float/real data types store?

A

numbers with decimals

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

what do boolean data types store?

A

true or false

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

what does the character data type store?

A

a single character

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

what type of error do you encounter when you use the wrong data type?

A

a type error

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

In sign and magnitude if the MSB is 0 what is the number

A

positive

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

what does MSB stand for?

A

Most Significant Bit

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

In sign and magnitude if the MSB is 1 what is the number

A

negative

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

In twos compliment if the MSB is 0 what is the number

A

positive

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

In twos compliment if the MSB is 1 what is the number

A

negative

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

What is the the biggest possible number able to be represented in two compliment?

A

+127

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

What is the the smallest possible number able to be represented in two compliment?

A

-128

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

what are the four parts of computational thinking?

A

decomposition, pattern recognition, abstraction, algorithms

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

What is decomposition?

A

breaking down a complex problem into smaller more manageable parts

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

What is pattern recognition?

A

looking for similarities among and within problems

17
Q

What is abstraction?

A

focuses on the important information only

18
Q

What are the two types of binary shifting?

A

Logical and arithmetic

19
Q

What effect does a logical left shift have?

A

multiplying by two

20
Q

during a logical left shift what is placed in the LSB

21
Q

What is the least significant bit (LSB)

A

the bit furthest to the right

22
Q

What effect does logical right shifting have?

A

dividing by two

23
Q

What is the problem with logical right shifting?

A

loss of precision

24
Q

in a right logical shift what is always placed in the empty MSB

25
What effect does a left arithmetic shift have?
multiplying by two
26
what is placed in the LSB in a left arithmetic shift?
0
27
What effect does a Right arithmetic shift have?
dividing by two AND KEEPING THE SIGN
28
What is different about Right arithmetic shifting
The msb is always maintained and copied into new spaces
29
What is the problem with left arithmetic shifting
When moving the signed number you might get inaccuracies or sign issues
30