Kibo Climb • Advanced Functions, Recursion & Algorithms
👑 Kibo Club VIP • Grades 6–8+
Climber: Kibo Climber Date: ____________ Score: _____ / 16 Time: _____ min
🧭 Directions: Complete each question carefully. Write your final answer in the blank or box provided.
1.
What is the final value of x when the loop terminates?
x = 1 while x < 32: x = x * 2 print(x)
2.
What does factorial(5) return?
def factorial(n): if n <= 1: return 1 return n * factorial(n - 1) print(factorial(5))
3.
What does fib(7) return?
def fib(n): if n <= 1: return n return fib(n - 1) + fib(n - 2) print(fib(7))
4.
Which climber is served first by dequeue()?
climber_queue = [] climber_queue.enqueue("Pip") climber_queue.enqueue("Tara") climber_queue.enqueue("Milo") first_up = climber_queue.dequeue() print(first_up)
5.
What is the value of total after the loop finishes?
total = 0 for i in range(1, 7): total += i print(total)
6.
What value is on TOP of the stack after these operations?
stack = [] stack.push(5) stack.push(20) stack.pop() # Removes top item (20) stack.push(30) stack.pop() # Removes top item (30) stack.push(47) print(stack.top())
7.
What gem is on TOP of the stack after these operations?
gem_stack = [] gem_stack.push("Diamond") gem_stack.push("Emerald") gem_stack.pop() # Removes top gem gem_stack.push("Topaz") gem_stack.pop() # Removes top gem gem_stack.push("Ruby") print(gem_stack.top())
8.
What is printed by accessing this dictionary key?
inventory = { "sparks": 41, "potions": 2, "scrolls": 6 } print(inventory["potions"])
9.
What is printed after calling find_max?
def find_max(a, b): if a > b: return a else: return b print(find_max(23, 31))
10.
What does factorial(4) return?
def factorial(n): if n <= 1: return 1 return n * factorial(n - 1) print(factorial(4))
11.
Searching sorted numbers 1 to 100 with binary search, what is the first midpoint checked?
12.
What is printed by this code?
climbers = ["Kibo", "Spark", "Trail", "Gem", "Summit"] print(climbers[2])
13.
What does factorial(3) return?
def factorial(n): if n <= 1: return 1 return n * factorial(n - 1) print(factorial(3))
14.
Searching sorted numbers 0 to 50 with binary search, what is the first midpoint checked?
15.
What is the value of total after the loop?
scores = [7, 5, 4, 9] total = 0 for s in scores: total += s print(total)
16.
What does fib(6) return?
def fib(n): if n <= 1: return n return fib(n - 1) + fib(n - 2) print(fib(6))
Parent Answer Key • Advanced Functions, Recursion & Algorithms
Verified Solutions
💡 Answer Key & Fast Grading Guide: Use this quick key to review solutions with your climber.
1. What is the final value of x when the loop terminates? 32
2. What does factorial(5) return? 120
3. What does fib(7) return? 13
4. Which climber is served first by dequeue()? "Pip"
5. What is the value of total after the loop finishes? 21
6. What value is on TOP of the stack after these operations? 47
7. What gem is on TOP of the stack after these operations? "Ruby"
8. What is printed by accessing this dictionary key? 2
9. What is printed after calling find_max? 31
10. What does factorial(4) return? 24
11. Searching sorted numbers 1 to 100 with binary search, what is the first midpoint checked? 50
12. What is printed by this code? "Trail"
13. What does factorial(3) return? 6
14. Searching sorted numbers 0 to 50 with binary search, what is the first midpoint checked? 25
15. What is the value of total after the loop? 25
16. What does fib(6) return? 8