Python 1
Binary & Hexadecimal
The Internet
Data
Python 2
100

The type of text in Python

String

100

Convert 52 to binary

110100

32 + 16 + 4

100

The protocol that reorders IP packets so that they can be delivered reliably

TCP

100

Compression that maintains all the original information

Lossless compression

100

val = 0

while val < 5:

     print(val + 1)


Infinit loop.  Val is never updated.  Prints 6 over and over

200

myList = [1, 1, 3, 5, 8, 13, 21]

for x in myList:

     sum = 0

     sum = sum + x

What is the value of sum?

21

200

Convert 11011010 (base two) to decimal

218 in decimal

200

Even if parts of the internet mesh network have broken paths, the data will still reach its destination.  This is called ______________.

Fault tolerance

200

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. 

200

Name all the data types we learned this year.

int, boolean, String, float

300

x = 1

x = x + x

x *= 3

x = 4 - x

What is the value of x?

x is -2

300

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.

300

What does it mean that Internet standards are "open"?

Any user of the Internet can use Internet protocols without paying or getting permission

300

When different people's access to technology can help or hurt different social groups

The digital divide

300

first = True

second = False

second = first

first = second


What are the values of first and second after this code runs?

True and True

400

4 + 5 * 3 - 18 % 2 equals...

19

400

The largest positive integer that can be represented with 8 bits:

255

400

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.

400

Give an example of metadata

Any data which gives information about other data

400

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

500

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

500

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

500

The amount of data that can be sent through a connection per unit of time

Bandwidth

500

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"

500

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]