The code looks polished, but the assumptions and edge cases still need checking. Spot what the AI missed before it ships.
An AI coding assistant wrote remove_duplicates(nums) to strip duplicate values from a list while keeping the order of first appearance. It looks clean and the comment sounds confident — but read the loop carefully.
An AI assistant wrote get_first_positive(nums) to return the first positive number in a list, or None if there isn't one. The comment references a 'built-in helper' — worth double-checking that it actually exists.
An AI assistant wrote find_largest(nums) to return the biggest number in a list, using its own comparison loop instead of anything built in. It reads carefully, and it works on the case the assistant probably tried.
An AI assistant wrote count_vowels(s) to count how many vowels are in a string, checking each character against an explicit list of vowels in a nested loop. It looks thorough — but that thoroughness is covering for something it never checks.
An AI assistant wrote is_weekend(day) to return True for "Saturday" or "Sunday", and False otherwise. It returns True for every day you try at first glance — worth checking why.
An AI assistant wrote safe_divide_all(nums, divisor) to divide every number in a list by divisor, returning None for any element it can't safely compute. It never seems to crash — but check what it actually returns when something goes wrong.
An AI assistant wrote count_word_occurrences(words) to count how many times each word appears, returned as a list of [word, count] pairs. It passes a quick manual check — but call it twice and watch closely.
An AI assistant wrote can_checkout(cart, has_payment_method) to return True only when the cart has items AND a payment method is on file. It nested the checks instead of handling each invalid case up front — and one case slipped through.
An AI assistant wrote add_to_total(n) to add n to a running total that's meant to persist across calls, using a module-level total variable. Calling it crashes immediately.
An AI assistant wrote find_common_elements(a, b) to return the elements that appear in both lists, with no duplicates in the result. It works on the simple case — try it with a repeated value in both lists.
An AI assistant wrote parse_and_sum(items) to add up a list of strings that represent integers, described as supporting 'any numeric expression.' It handles plain numbers fine — the concern is what tool it reached for, and what happens on bad input.
An AI assistant wrote get_item(items, index) to safely look up a list index, returning None instead of crashing when the index doesn't exist. It looks defensive — but check what actually happens on a real out-of-range index.