Alex DiFazio579 Points
Not understanding code challenge
I'm beyond baffled by the instructions in this code challenge, and I'm unsure where to turn for an explanation of how to complete what it's asking. The challenge loses me completely with what it's asking to return, but as a whole I'm not grasping the concept or goal of this challenge.
Any help is appreciated. I've attached my "code" for reference, but I highly doubt it will be of use, being that I don't even know what my target is.
# EXAMPLE # random_item("Treehouse") # The randomly selected number is 4. # The return value would be "h" import random def random_item(argument): number = random.randint(0, 6) return argument.index('number')
Steven Parker173,522 Points
Basically, if you give this function a list, you get back one item from it. And if you give it a string, you get back one character from it. In either case, the one it gives back should be picked randomly.
The example shows giving it "Treehouse" and getting back "h", but it could also have given back "s" or "u" or any of the other letters.
Does that make more sense?