computer science Flashcards
(30 cards)
what are the 5 primitive data types in python?
integer, float/real, character, boolean and string
what does an integer data type store
whole numbers
what do float/real data types store?
numbers with decimals
what do boolean data types store?
true or false
what does the character data type store?
a single character
what type of error do you encounter when you use the wrong data type?
a type error
In sign and magnitude if the MSB is 0 what is the number
positive
what does MSB stand for?
Most Significant Bit
In sign and magnitude if the MSB is 1 what is the number
negative
In twos compliment if the MSB is 0 what is the number
positive
In twos compliment if the MSB is 1 what is the number
negative
What is the the biggest possible number able to be represented in two compliment?
+127
What is the the smallest possible number able to be represented in two compliment?
-128
what are the four parts of computational thinking?
decomposition, pattern recognition, abstraction, algorithms
What is decomposition?
breaking down a complex problem into smaller more manageable parts
What is pattern recognition?
looking for similarities among and within problems
What is abstraction?
focuses on the important information only
What are the two types of binary shifting?
Logical and arithmetic
What effect does a logical left shift have?
multiplying by two
during a logical left shift what is placed in the LSB
0
What is the least significant bit (LSB)
the bit furthest to the right
What effect does logical right shifting have?
dividing by two
What is the problem with logical right shifting?
loss of precision
in a right logical shift what is always placed in the empty MSB
0