Python 1
Binary & Hexadecimal
The Internet
Data
Python 2
100

The type of text in Python

String

100

All the digits in hexadecimal

0 1 2 3 4 5 6 7 8 9 a b c d e f

100

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

TCP

100

Compression that maintains all the original information

Lossless compression

100
If you have a list called "myList", how do you get its length?

len(myList)

200

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

What is the value of myList[5]?

13

200

Convert 1101 (base two) to decimal

13 in decimal

200

The property of a system being able to handle some failures and still work well

Fault tolerance

200

Image data is usually encoded as:

three-byte RGB values

200

The type of whole numbers in Python

int

300

x = 1

x = x + x

x *= 3

x = 4 - x

What is the value of x?

x is -2

300

A byte is almost always ___ bits

8

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 fit in a byte:

255

400

A message delivered through UDP is...

Not guaranteed to arrive, or may have packets out of order

400

Give an example of metadata

Any data which gives information about other data

400

What does this function do?

def f(l):

    result = []

    for element in l:

        result = [element] + 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

Write 42 in octal (base 8)

52

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]

M
e
n
u