I'm a newbie so please bear with me:
import random
directions = ['north', 'east', 'south', 'west']
bad_directions = directions[:]
good_direction = random.sample(directions,1)
good_direction = str(good_direction).replace('[','').replace(']','')
bad_directions.remove(good_direction)
print bad_directions
This raises ValueError:
Traceback (most recent call last):
File "directions.py", line 9, in <module>
bad_directions.remove(good_direction)
ValueError: list.remove(x): x not in list
I tried checking the types of "good_direction" and "bad_directions[1]" just to see if they're the same and they're both string.