Re Following syntax error in Mac OX10.7 Terminal

MRAB python at mrabarnett.plus.com
Fri Jun 29 11:21:56 EDT 2012


On 29/06/2012 16:13, David Thomas wrote:
> On Thursday, June 28, 2012 6:30:42 PM UTC+1, Sergi Pasoev wrote:
>> You just have to consider that indentation matters in Python, so you
>> have to type the code in Python interpreter as you have written it
>> below, that is, press Tab before each line when you are inside the
>> 'while (or any other like for, if, with, etc.) block.
>>
>> a=0
>> while a<10:
>>     a=a+1
>>     print a
>>
>> I can guess from your message that you aren't aware of one very
>> important Python feature, and maybe you also didn't willingly choose to
>> learn Python2 instead of Python3 ? In this case I would advise you to
>> consider both versions before choosing.
>
> Hi yeah I'm currently learning python 2 at the moment and the tutorial that
> I am studying doesn't explain about indentation.
>
Really? Indentation is a basic feature of Python!



More information about the Python-list mailing list