When Python reacts
So, the issues are:
import matplotlib pyplot
should be:
import matplotlib.pyplot
agents.append([random.randint(0,99),random.randint(0,99))
should be:
agents.append([random.randint(0,99),random.randint(0,99)])
agents.append([random.randint(0,99) random.randint(0,99)]):
should be:
agents.append([random.randint(0,99), random.randint(0,99)]):
and, infact:
agents.append([random.randint(0,99), random.randint(0,99)])
if random.random() < 0.5
should be:
if random.random() < 0.5:
If you found one or more of these, great! If you found them all, that's really great. Here's a copy with all the above errors fixed: test3.py.
However, we're not clear of the woods yet. Indeed, we're in the darkest bit of the woods, as there's still three issues in the file, and these are the trickest kind of issue, as they are issues of logic not syntax: the code runs, but in the wrong way. Can you spot anything in any of the chunks of code that don't look like they're right?