python error

1. IndentationError: expected an indented block

------缩进问题

>>> for i in ['1','2','3','4']:
... t = s + i
  File "<stdin>", line 2
    t = s + i
    ^
IndentationError: expected an indented block

 

修改后

>>> for i in ['1','2','3','4']:
...     t = s + i
...     print t
...
string1
string2
string3
string4

发布了45 篇原创文章 · 获赞 3 · 访问量 14万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章