(Blank)
(Blank)
(Blank)
(Blank)
(Blank)
100

What Are The 4 Parts of a While Loop?

Identify Loop Var, Initialize Loop Var, Condition While Loop, Update Loop Var 

100

print(10 / 0) 

Is an example of?

Traceback error

(cannot divide by zero)

100

if x > 5
  print("x is greater than 5")

is an example of...

Syntax Error

100

What should be implemented in any code to perform iteration?

A loop

100

T or F:

A while loop will continue to iterate forever unless it meets a condition to stop.

True

200

This keyword is used to define a function.

def

200

This type can return True or False statements...

bool

200

The keyword used to check that a condition has been deemed True

if

200

What built in function is used to add an item to the end of a list?

append()

200
Returns the number of elements in a list.

Len() or Length

300

How would you convert a string to all be uppercase?

.upper()

300

What is wrong with this code

s = 'Phantom Opera'

index = len(s)-1

while index >= 0

    print(chr(ord(s[index])+1),end='')

    index -= 1

while index >= 0:

300

How can your program exit a loop before it finishes iterating?

Break

300

How can you get an input from a user in a python program?

input()

300

Is this variable correct?

2DiskMove = print("Hello world!")

No!

400

for i in range(1, 6):

    print(i * 2)

What does the following code output?


2

4

6

8

10

400

What is the one statement that Dr.Rasamny apparently hates to see in code.

Break 

400

When // that is seen in code what does it mean happens in the line of code.

It gives the answer to a division problem without a remainder.

400

my_list = [2, 0, 3, 4, 5, 6, 7]

Reorder this list to look like this [0, 1, 2, 3, 4, 5, 6, 7, 8] and all changes to this list must be permanent and be imbedded in the list.


my_list.append(8)

my_list.insert(0,1)

my_list.sort()

400

What is a dictionary in python?

A dictionary in Python is a built-in data structure that stores data in key-value pairs. Each key is unique and maps to a specific value, making dictionaries highly efficient for data retrieval.

500

What function must be used to take the string 'venture' out of the variable jake_dog.

jake_dog = 'adventure' 

jake_dog[2:]

500

cool_ranch = 20


for i in range(5):

    if cool_ranch % 3 == 0:

        cool_ranch = cool_ranch - 5

    else:

        cool_ranch = cool_ranch + 2

What is the final value of cool_ranch?

cool_ranch = 16

500

life = 50

saver = 5


while life >= saver:

 life = life // saver

 saver = saver + 1

What are the final values of life, saver, and (life < saver)? True or False?


 

life = 1

saver = 7

(life < saver) = True

500

logi = 18

dell = 2


while not (logi <= dell):

    logi = logi - dell * 2

    dell = dell * 3

What are the final values of logi and dell?

logi = 2

dell = 18

500

pro = 15

app = 0

tut = 4

while not (pro < tut):

    pro = pro - tut

    app = app + 2


What are the final values of pro, app, tut, and (life < saver)? True or False?


pro = 3

app = 6

tut = 4

(pro < tut) = True

M
e
n
u