is it idle, or my program
this program works with idle python shell but not in python
for n in [1,2,3,4]rint n
# this works just fine in the 'python shell'.
It works fine for me. Are you sure you typed it correctly?
I presume when you say 'from the python command prompt' you mean saving it to a file and executing it. When you say it doesn't work, what happens? Does it throw an exception, or hang? What version of Python are you using? What OS? How are you running it?
Dave - The Developers' Coach