The type of text in Python
String
Convert 52 to binary
110100
32 + 16 + 4
The protocol that reorders IP packets so that they can be delivered reliably
TCP
Compression that maintains all the original information
Lossless compression
val = 0
while val < 5:
print(val + 1)
Infinit loop. Val is never updated. Prints 6 over and over
myList = [1, 1, 3, 5, 8, 13, 21]
for x in myList:
sum = 0
sum = sum + x
What is the value of sum?
21
Convert 11011010 (base two) to decimal
218 in decimal
Even if parts of the internet mesh network have broken paths, the data will still reach its destination. This is called ______________.
Fault tolerance
When converting Analog to Digital, We should make sampling size ________ so that the is a ________ frequency of data points.
smaller
so that there is a
higher frequency
of data points.
Name all the data types we learned this year.
int, boolean, String, float
x = 1
x = x + x
x *= 3
x = 4 - x
What is the value of x?
x is -2
How many bits are needed to represent 128 different unique values? We always want to use the least possible.
7
Seven bits have a range from 0-127, which is 128 unique values.
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 be represented with 8 bits:
255
Routers communicate with each other to help decide the best (fastest) path to send data packets on the Internet.
True or False
False,
They work independently.
Give an example of metadata
Any data which gives information about other data
What does this function do?
list = ["a", "b", "c]
def doesSomething(list):
result = []
for i in range(len(list)):
result = list[x] + 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
You use 5 bits in your program for game characters. You have 27 characters. How many more can you add without adding more bits?
5
2^5 = 32 unique values
32-27 = 5 left over
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]