[python-chinese] 求助for作用域

limodou limodou在gmail.com
星期四 十一月 1 15:05:34 HKT 2007


for 与 其它的块语句一样,当遇到缩近与for相同或少于for的语句时就结束了。所以当碰到下面的while时因为缩近相同,所以在while前就结束了。

On 11/1/07, xunkai wei <xunkai.wei在gmail.com> wrote:
> 各位大虾,
>
>     for feature_id in range(len(feature_set)):
>         # get the feature we're looking at (h_i)
>         feature = feature_set[feature_id]
>
>         # determine the subset of negative_examples_set (N)
>         # covered by our feature (h_i)
>         Q[feature_id] = \
>             filter( lambda (is_positive, data_point) :
> feature.covers_neg_point(data_point) , \
>                 negative_examples_set)
>
>         # determine the subset of positive_examples_set (P) on
>         # which our feature (h_i) makes a mistake
>         R[feature_id] = \
>             filter( lambda (is_positive, data_point) :
> feature.errs_pos_point(data_point) , \
>                 positive_examples_set)
> 作用域是不是到这结束?
>
>
>     while (len(negative_examples_set)>0) and
> (len(result_set)<stopping_point):
>
>         iterations = iterations+1
>
> 谢谢
>
>


-- 
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
meide <<wxPython UI module>>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou


关于邮件列表 python-chinese 的更多信息