Python Python Basics (2015) Letter Game App Random Item

Didier Borel
Didier Borel
2,837 Points

what file are they referring to ?

a basic administrative question. often in the instructions for a code challenge , it says "check the file for an example". as in the example below. What file are they referring to, where do I find it?

example of a code challenge:

You've seen how random.choice() works. It gets a random member from an iterable (like a list or a string). I want you to try and reproduce it yourself. First, import the random library. Then create a function named random_item that takes a single argument, an iterable. Then use random.randint() to get a random number between 0 and the length of the iterable, minus one. Return the iterable member that's at your random number's index. Check the file for an example.

1 Answer

Alex Koumparos
MOD
Alex Koumparos
Python Web Development Treehouse Moderator 32,442 Points

The file they are referring to in this case is 'item.py', which is the file you are typing your solution into.