Programming
Code Tracing
Algorithms
Data & Computing
Internet & Cyber
100

What keyword defines a function in Python?

What is def?

100

What is printed?

x = 4
print(x + 2)

What is 6?

100

What is an algorithm?

What is a step-by-step solution?

100

What number system do computers use?

What is binary?

100

What does the internet use to send data?

A: What are packets?

200

What is the output type of input()?

What is a string?

200

What is printed?

x = 3
if x % 2 == 0:
    print("Even")
else:
    print("Odd")

What is Odd?

200

What search is faster on large sorted lists?

What is binary search?

200

What is a bit?

What is a 0 or 1?

200

What does DNS do?

What is converts domain names to IP addresses?

300

What does len() do?

What is returns the length of a string or list?

300

What is printed?

total = 0
for i in range(1, 5):
    total += i
print(total)

What is 10?

300

A list has 20 elements. What is the maximum number of comparisons needed to find a value using linear search?

What is 20?

300

How many bits are in a byte?

What is 8?

300

What is an IP address?

What is a unique identifier for a device?

400

What is the difference between = and ==?

What is assignment vs comparison?

400

What is printed?

nums = [1, 2, 3]
nums[0] = nums[1]
print(nums)

What is 2,2,3?

400

You are searching for a name in a sorted list of 1,000 items. Which algorithm would be more efficient, and why?


What is binary search, because it eliminates half the list each step?

400

What is data abstraction?

What is simplifying data using structures (like lists)?

400

What is encryption?

What is encoding data to protect it?

500

What error occurs if you divide by zero?

What is a runtime error (ZeroDivisionError)?

500

What is printed?

def mystery(x):
    if x > 5:
        return x - 2
    else:
        return x + 2

print(mystery(5))

What is 7?

500

A program uses linear search to find a value in a list of 200 items. The value is located at index 0 in one test and at index 199 in another test.
What is the difference between these two cases in terms of efficiency?

What is best case = 1 step, worst case = 200 steps?

500

Why is data compression used?

What is to reduce file size for storage/transmission?

500

What is redundancy in the internet?

What is multiple paths for reliability?