Algorithms
Syntax & Interpretation
Loops & Containers
What's Missing?
Terms
100

A method to solve problems through repetition of a consistent set of steps.

What is an Algorithm?

100

The final value of x after these operations:
x = 3
y = 9
y = y + x
x = y / x
x = x**2

What is 16?

100
A form of loop that functions by iterating through an iterable object or container.

What is a for loop?

100

(same should check if y and x are equivalent)

def same(x, y):
    if _____:
          return True
    else:
          return False

x == y

100

The name for the result of any series of operations that results in only two possible outcomes; often denoted with True or False.

What is a Boolean Expression?

200

An algorithm that continually adds to a value or container.

What is an Accumulator Pattern?

200

The value of y after completion of the loop.
x = 7
y = 0
while y < x:
      y += 2
      x -= 1

What is 6?

200

A form of loop that continues or terminates based on a Boolean expression.

What is a while loop?

200

(remainder should return what remains after integer dividing y from x)

def remainder(x: int, y: int):
   return _____

x % y

200

The term for a defined placeholder for a variable to be passed in when calling a function.

What is a Parameter(or Formal Argument)?

300

An algorithm that tends a set of points toward the centers of a greater set of points and determines subsets of the greater set of points.

What is k-means Cluster?

300

The value printed to shell from the following code:

x = [ 'B', 25, [ 'a', 'e', 'i', 'o', 'u']]
print( x[0] + (3 * x[2][3]))

What is Booo?

300

An indexable container which holds all its elements in order, but cannot change in size or otherwise be modified.

What is a tuple?

300

(assume no floats)

def do_stuff(x:___, y:___, z:___)_____:
    q = x * y
    m = z + '2'
    return {m:q}

int ; int ; str ; -> dict[str:int]

300

The ability to modify an object without needing to reassign or recreate it.

What is Mutable?

400

The process of having a function call itself until it reaches a base case where it stops and returns.

What is Recursion?

400

The return of the following code:
x = [(2 - i) for i in range(5)]
print(sum(x))

What is 0?

400

An unordered container that is syntactically defined with '{}' and stores elements in pairs.

What is a dictionary?

400

(Factorial is: 4! = 1 * 2 * 3 * 4)

def factorial(num):
    if num == 1:
          return 1
    else:
          return ____

num * factorial(num - 1)

400

A function that specifically is called on an object of some sort, noted by the '.' that follows the object it is being called on.

What is a Method? 

500

A process that logically divides a organized list in half until finding a desired value.

What is Binary Search?

500

The return of the following code:
foo = {str(x): x**2 for x in [1,2,3,4]}
for a, b in foo.items():
    print(f"{a} : " , b - int(a))

1 :  0
2 :  2
3 :  6
4 :  12

500

The generic term for the process of filling a container by a loop process.

What is Comprehension?

500

(the following function will return a list with two elements , one of which is y and the other is a repetition of y and must use both x and y. eg: x = 3, y = 'qw' result: ['qw', 'qwqwqw'])

def my_func(x:int, y:str) -> list[str]:
    m = []
    m._____
    m._____
    return m

.append(y) ; .append(y*x)

500

A separate file of code that can be added in to the current file in order to use its functions.

What is a Module?

M
e
n
u