⚠ simulated AI-generated code
This code is framed as if an AI coding assistant wrote it, and has a realistic issue AI assistants actually produce — sometimes a real bug, sometimes code that runs fine but is more complicated or less idiomatic than it needs to be. It is not from a real model call. Read it like you'd review any AI suggestion — don't assume it's correct, or well-written, just because it looks polished.
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.
fix this code so it matches
get_item([10, 20, 30], 1) is 20. get_item([10, 20, 30], 0) is 10. get_item([10, 20, 30], 5) is None (out of range). get_item([10, 20, 30], -1) is 30.