The type of text in Python
String
All the digits in hexadecimal
0 1 2 3 4 5 6 7 8 9 a b c d e f
The protocol that orders IP packets so that they can be delivered reliably
TCP
Compression that maintains all the original information
Lossless compression
len(myList)
myList = [1, 1, 3, 5, 8, 13, 21]
What is the value of myList[5]?
13
Convert 1101 (base two) to decimal
13 in decimal
The property of a system being able to handle some failures and still work well
Fault tolerance
Image data is usually encoded as:
three-byte RGB values
The type of whole numbers in Python
int
x = 1
x = x + x
x *= 3
x = 4 - x
What is the value of x?
x is -2
A byte is almost always ___ bits
8
What does it mean that Internet standards are "open"?
Any user of the Internet can use Internet protocols without paying or getting permission
When different people's access to technology can help or hurt different social groups
The digital divide
first = True
second = False
second = first
first = second
What are the values of first and second after this code runs?
True and True
4 + 5 * 3 - 18 % 2 equals...
19
The largest positive integer that can fit in a byte:
255
A message delivered through UDP is...
Not guaranteed to arrive, or may have packets out of order
Give an example of metadata
Any data which gives information about other data
What does this function do?
def f(l):
result = []
for element in l:
result = [element] + result
return result
Reverses the list l
Write a function to sum all the numbers in a list, but only if they are below 10
sum = 0
for n in list:
if n < 10:
sum += n
Write 42 in octal (base 8)
52
The amount of data that can be sent through a connection per unit of time
Bandwidth
In Python, 0.1 + 0.2 == 0.3 returns False. Why?
Binary encodings of non-integer numbers are limited in their accuracy, so 0.3 cannot be exactly represented and must be "rounded off"
myList = [1, 2, 3]
final = []
for i in range(len(myList)):
final += myList[i:]
What is the value of final after this code runs?
[1, 2, 3, 2, 3, 3]