28. Fill in the blanks to complete the “even_numbers” function. This function should return a space-separated string of all positive even numbers, excluding 0, up to and including the “maximum” variable that's passed into the function. Complete the for loop so that a function call like “even_numbers(6)” will return the numbers “2 4 6”.
29. What happens when the Python interpreter executes a loop where a variable used inside the loop is not initialized?
33. The following code is supposed to add together all numbers from x to 10. The code is returning an incorrect answer, what is the reason for this?
x = 1
sum = 5
while x <= 10:
sum += x
x += 1
# Should print 55
34. The following code causes an infinite loop. Can you figure out what is incorrect?
def test_code(num): x = num while x % 2 == 0: x = x / 2
x = num
while x % 2 == 0:
x = x / 2