Debug real beginner mistakes
Ordinary debugging, one bug at a time. Visible tests, progressive hints, and edge cases turn each fix into deliberate practice.
Easy
Difficulty: EasyNumbers up to n
numbers_up_to(n) should return a list of every whole number from 1 to n, inclusive. Right now the last number is missing.
Is it even?
is_even(n) should return True when n is even. Right now it's backwards.
Is it in range?
in_range(n, low, high) should return True when n is low, high, or anywhere between them. Right now the endpoints themselves don't count.
Build a greeting
build_greeting(name, age) should return a message like "Hi Sam, age 10". Right now calling it crashes.
Medium
Difficulty: MediumIndex of the maximum
index_of_max(nums) should return the position of the largest number in the list — not the number itself.
Capitalize every word
capitalize_each(words) should return a new list with every word capitalized. Right now it only processes the first word.
Average of three
average(a, b, c) should return the average of all three numbers. Right now the result is way off.
First even number
first_even(nums) should return the FIRST even number in the list, or None if there isn't one. Right now it returns the wrong one.
Hard
Difficulty: HardCountdown list
countdown_list(n) should return a list counting down from n to 1. Careful running this one — as written, it may never finish.
Average, or zero
average_or_zero(nums) should return the average of the numbers in the list, or 0 if the list is empty.