Whitespace Means Right Space
2013-04-01 23:04
176 查看
Whitespace Means Right Space
Notice the error you got when you ran the code in the editor:
You'll get this error whenever your Python whitespace is out of whack. (If you've studied JavaScript, think of improper whitespace as improper use of
When your punctuation's off, your meaning can change entirely:
The peasant said, "The witch turned me into a newt!"
"The peasant," said the witch, "turned me into a newt!"
See what we mean?
INSTRUCTIONS
Properly indent the code to the right by hitting the spacebar key on your keyboard four times on line
2 (before
and another four times on line 3(before
Click "run" once you've done this.
def spam(): eggs = 12 return eggs print spam()
Notice the error you got when you ran the code in the editor:
IndentationError: expected an indented block
You'll get this error whenever your Python whitespace is out of whack. (If you've studied JavaScript, think of improper whitespace as improper use of
;or
{}.)
When your punctuation's off, your meaning can change entirely:
The peasant said, "The witch turned me into a newt!"
"The peasant," said the witch, "turned me into a newt!"
See what we mean?
INSTRUCTIONS
Properly indent the code to the right by hitting the spacebar key on your keyboard four times on line
2 (before
eggs)
and another four times on line 3(before
return).
Click "run" once you've done this.
相关文章推荐
- ie7下使用white-space:nowrap时padding-right失效问题记录
- Eclipse---设置show whitespace characters
- The JSP specification requires that an attribute name is preceded by whitespace
- jsp页面 The JSP specification requires that an attribute name is preceded by whitespace
- C# Tips: How to remove white-space characters inside a string?
- 换行-white-space, word-wrap, word-break
- 一篇关于CSS 中的white-space属性
- css里white-space:nowarp代表超出边框不换行
- 【源码分析】你必须知道的string.IsNullOrEmpty && string.IsNullOrWhiteSpace
- eclipse中show whitespace characters按钮编辑器中显示导致恶心的乱码
- The JSP specification requires that an attribute name is preceded by whitespace
- white-space: nowrap
- CSS 不换行 white-space 属性详解
- 判定NSString是否为nil,empty或者all whitespace
- CSS3 Word-wrap、word-break、white-space
- [转]ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report
- HTML5基础加强css样式篇(CSS3 文本 - 英文单词截断与不截断:word-break,overflow-wrap,white-space)(四十二)
- white-space: nowrap;强制标签不换行
- white-space对select无效
- Whitespace is not allowed before an XML Processing