摘要: 当列表被传递给函数时,由于列表是一个可变对象,所以列表的内容肯回在函数调用后改变。def main(): x =1 y = [1,2,4] m(x, y) print("x is ", x) print("y[0] is", y... 阅读全文
posted @ 2016-01-14 16:26 Jeff_blog 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 答案就是2/3,但隐含的前提是,男女出生率相同如果男女出生率不同,猜一猜答案会不会不同? """ import randomborn_boy_rate = 0.5born_girl_rate = 0.5def another_is_girl_rate(): # 包含男孩的组合数量 num_with_ 阅读全文
posted @ 2016-01-14 15:29 Jeff_blog 阅读(118) 评论(0) 推荐(0) 编辑