I keep getting a "Bummer! NameError: name 'random_item' is not defined" error in a challenge
The only occurrence of 'random_item' on the page is a default example which is commented out - I removed this but the same error appears. Even after clearing all data from the challenge code box, then attempting to check answer again, the same error is displayed.
# EXAMPLE # random_item("Treehouse") # The randomly selected number is 4. # The return value would be "h" import random def random_int(iterable): random_letter = random.randint(0, len(iterable) - 1) return iterable[random_letter]
Steven Parker182,323 Points
It's not Python that's complaining but the challenge.
The instructions say "create a function named random_item" but your function is named "random_int" instead.