From 47729fba5fe1f6de399a5fa0b5fb599ae2dde796 Mon Sep 17 00:00:00 2001 From: Abhishek Ravi Date: Mon, 19 Oct 2015 00:17:18 -0400 Subject: [PATCH] Update REVIEW2.md Minor changes to have runnable code snippets --- src/doc/REVIEW2.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/doc/REVIEW2.md b/src/doc/REVIEW2.md index 4dccced..7c0f90e 100644 --- a/src/doc/REVIEW2.md +++ b/src/doc/REVIEW2.md @@ -28,7 +28,7 @@ def items(x, depth=-1): for z in items(y, depth+1): yield z else: - yield _,x + yield _,x out = [] for _,x in items( [10,[ 20,30], @@ -36,7 +36,7 @@ for _,x in items( [10,[ 20,30], [ ( 50,60,70), [ 80,90,100],110]]): out += [x] -return out +print out ``` 1c. Repeat the above, this time using _list comprehensions_. @@ -64,7 +64,7 @@ def lines(string): else: tmp += ch if tmp: - yield tmp + yield tmp ``` ### 2. Dunders @@ -87,6 +87,7 @@ class o: was deleted? ```python +from __future__ import division r = random.random rseed = random.seed