IndentationError: unexpected indent

来源:互联网 发布:nba2k14流畅优化补丁 编辑:程序博客网 时间:2024/05/17 19:59

源代码:mail=tom:\n hello\n i am jack

print mail

\n表示换行,为了格式需要

File "D:/Python/Python ����/test.py", line 2

    mail='tom:\n  hello\n i am jack'
   

IndentationError: unexpected indent


解决方法:mail之前不要有空格 print之前也不要有空格

结果如下:
tom:
  hello
 i am jack

0 0
原创粉丝点击