Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

变量赋值的异常 #23

Closed
wanghaisheng opened this issue Aug 24, 2015 · 6 comments
Closed

变量赋值的异常 #23

wanghaisheng opened this issue Aug 24, 2015 · 6 comments

Comments

@wanghaisheng
Copy link


在109-113.md中大量出现了如下的情况,是笔误还是有意为之,望解答

>>> all_users
['python', 'http://', 'qiwsir', 'github', 'io', 'algorithm']

为什么不是

>>> all_users = 
['python', 'http://', 'qiwsir', 'github', 'io', 'algorithm']
@qiwsir
Copy link
Owner

qiwsir commented Aug 25, 2015

all_users是不是已经存在的变量?不是赋值。

2015-08-24 22:13 GMT+08:00 wanghaisheng notifications@github.com:


在109-113.md中大量出现了如下的情况,是笔误还是有意为之,望解答

all_users
['python', 'http://', 'qiwsir', 'github', 'io', 'algorithm']

为什么不是

all_users =
['python', 'http://', 'qiwsir', 'github', 'io', 'algorithm']


Reply to this email directly or view it on GitHub
#23.

QiWei

@wanghaisheng
Copy link
Author

@qiwsir 比如109.md 最后一个示例中的b 112.md中的第一个例子中的la

@qiwsir
Copy link
Owner

qiwsir commented Aug 25, 2015

109.md中的最后一个示例中的b,已经在前面做了赋值 b=a.title()

@wanghaisheng
Copy link
Author

如果你指的是

>>> b = a.title()     #这样就把所有单词的第一个字母转化为大写
>>> b
'This Is A Book'

那最后的例子里你写的是

>>> b
'www.itdiffer.com'

@qiwsir
Copy link
Owner

qiwsir commented Aug 25, 2015

因为我在写教程的过程中,中间要做调试。所以,变量值会变化。为了说明后面操作的变量值是什么,我一般要在示例开始,把已经有的变量值显示出来,比如你刚才说的>>>b,这样主要是告诉读者,现在b的变量值已经是什么了。至于如何来的,一般就比较简单,不用赘述了。

2015-08-25 13:58 GMT+08:00 wanghaisheng notifications@github.com:

如果你指的是

b = a.title() #这样就把所有单词的第一个字母转化为大写
b
'This Is A Book'

那最后的例子里你写的是

b
'www.itdiffer.com'


Reply to this email directly or view it on GitHub
#23 (comment)
.

QiWei

@wanghaisheng
Copy link
Author

这样说就易于理解了,如果不追求严谨的话

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants