I am trying to locate a random value from one array in another array:
team1Players = random.sample(activePlayers, 4)
print(team1Players[0])
index1 = overallPoints.index(f'{team1Players[0]}')
The above code yields the following output:
/Users/johnbeatty/PycharmProjects/THTTeamMakerv2/venv/bin/python /Users/johnbeatty/PycharmProjects/THTTeamMakerv2/main.py
playerName
Traceback (most recent call last):
File "/Users/johnbeatty/PycharmProjects/THTTeamMakerv2/main.py", line 237, in <module>
index1 = overallPoints.index(f'{team1Players[0]}')
ValueError: 'playerName' is not in list
Process finished with exit code 1
I do not see why there should be a problem here; Python clearly recognizes the playerName and its name in the list... Would anybody be able to help me out here?