On 6/29/2012 10:58 AM, David Thomas wrote:
> Just discovered this in the tutorial further down. I'm currently learning
> Python 2 because there seems to be a lot of tutorials out there covering
> Python 2 rather than 3.
The latest edition (3rd?) of Programming Python by Mark Lutz covers py3k
(it
> Just discovered this in the tutorial further down. I'm currently
> learning Python 2 because there seems to be a lot of tutorials out there
> covering Python 2 rather than 3.
While deciding which version of Python to learn, a better counsel could
be found here:
http://wiki.python.org/moin/Pyth
David Thomas writes:
> Hi yeah I'm currently learning python 2 at the moment and the tutorial
> that I am studying doesn't explain about indentation.
You might be better served by the official Python tutorial
http://docs.python.org/tutorial/>.
If you work through it from beginning to end, doing
On Friday, June 29, 2012 4:21:56 PM UTC+1, MRAB wrote:
> 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 ha
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 ar
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 li
Thank you very much I didn't realise that the indentation was important. The
IDE indents automatically whilst terminal doesn't.
Thanks for pointing it out.
--
http://mail.python.org/mailman/listinfo/python-list
On 6/28/2012 12:11 PM, David Thomas wrote:
> Hi,
> I have the following error regarding a loop tutorial found on
> http://www.sthurlow.com/python/lesson04/
>
a=0
while a<10:
> ... a=a+1
> File "", line 2
> a=a+1
> ^
> IndentationError: expected an indented block
You indented
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