Q:

Syntax Error with lists in Python

python version: 2.71
I get a syntax error whenever I try to run it with IDLE....
horsemen = ["war", "famine", "pestilence", "death"]
i = 0
while i < 4:
    print horsemen[i]
    i = i + 1 

The error occurs between horsemen and the equal sign

A:

Is there any reason you cannot use a for loop?
for god in horsemen:
    print god

A:

The code is fine (syntactically). You must have a problem with your python environment. Also make sure it is properly indented.

