Найти - Пользователи
Полная версия: Странная ошибка в print
Начало » Python для новичков » Странная ошибка в print
1
alexparser
Доброго времени суток!

Я новичек, объясните мне пожалуйста, почему в простом пимере на питоне вылетает ошибка.
код

the_world_is_flat = 1
if the_world_is_flat:
print “Be careful not to fall off!”

выполнение
———-
Python 2.7.1 (r271:86832, Jun 23 2011, 02:40:44)
[GCC 4.2.1 20070719 ] on freebsd8
Type “help”, “copyright”, “credits” or “license” for more information.
>>> the_world_is_flat = 1
>>> if the_world_is_flat:
… print “Be careful not to fall off!”
File “<stdin>”, line 2
print “Be careful not to fall off!”
^
IndentationError: expected an indented block


Заранее спасибо!
Андрей Светлов
Четыре пробела перед print добавьте.
alexparser
Андрей Светлов
Четыре пробела перед print добавьте.
Спасибо, у питона прикольный синтаксис :)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB