Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (Retired) Dungeon Game Random Choices

Ahmed Elsawey
PLUS
Ahmed Elsawey
Courses Plus Student 3,527 Points

What does the question mean? and how can you do it?

I have no clue what the question is so can you explain it to me? also please tell me the answer. As soon as possible please can you check out my other questions. Kenneth Love Ricky Catron

choices.py
def nchoices(list, int):

1 Answer

Ricky Catron
Ricky Catron
13,023 Points

The question means take a list and return the amount of items specified in the second variable you called int.

AKA return if int = 7 return 7 items from the list.

I can't just give you the answer that isn't really how this works but you could do something like list[:7] which would give you the first 7, or list[-7:] which would give you the last 7.

Goodluck! --Ricky