5/12/2008

where is this (..censored) "... " ???

This is easy peace of code, that doesn't executes
ANd I don't know why:

>>> the_world_is_flat=1
>>> #if the land is flat, prevent the falling
... if the_world_is_flat:
... print "Warning! Possibile falling"
File "", line 3
print "Warning! Possibile falling"
^
IndentationError: expected an indented block
>>>



http://www.python.org/doc/lib/module-BaseHTTPServer.html

4 коментарі:

Creator сказав...

http://zope.net.ru/Python/

Traut сказав...

Читай, что тебе говорит компилятор - там все понятно

IndentationError: expected an indented block

т.е. в синтаксисе питона большое значения ключевую роль играют отступы, так как отсутствуют пометки начала/конца блока.
Ты о базисном синтаксисе читала?

вот ты и пропускаешь в if-блоке отступ - потому получаешь ошибку, т.к. компилятор не знает как толковать твой код

Olusia сказав...

use tab instead of space after keyword "print"

Creator сказав...

Not after "Print" but before )))
)))
Thx!!
I'm so happy!! ))