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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章