0

Im trying to figure out how to select random choices in my list but up to a certain amount or even random indexes in my list. I've tried this so far

import random

TeamsList = [
    "49ers", "Raiders", "Cowboys"
]

teamw = random.choice(TeamsList[0:1])


print(teamw)

But its only giving me my first choice as in 49ers only. I would like it to give a random output of the first 2 indexes. Or if possible a choice at random between index 1 and 2.

0 Answers0