Show More
@@ -17,10 +17,10 b' def pyfunc():' | |||||
17 | 5 |
|
17 | 5 | |
18 |
|
18 | |||
19 | >>> for i in range(3): |
|
19 | >>> for i in range(3): | |
20 |
... print |
|
20 | ... print(i, end=' ') | |
21 |
... print |
|
21 | ... print(i+1, end=' ') | |
22 | ... |
|
22 | ... | |
23 | 0 1 1 2 2 3 |
|
23 | 0 1 1 2 2 3 | |
24 | """ |
|
24 | """ | |
25 | return 'pyfunc' |
|
25 | return 'pyfunc' | |
26 |
|
26 | |||
@@ -34,10 +34,10 b' def ipfunc():' | |||||
34 | Out[3]: 5 |
|
34 | Out[3]: 5 | |
35 |
|
35 | |||
36 | In [26]: for i in range(3): |
|
36 | In [26]: for i in range(3): | |
37 |
....: print |
|
37 | ....: print(i, end=' ') | |
38 |
....: print |
|
38 | ....: print(i+1, end=' ') | |
39 | ....: |
|
39 | ....: | |
40 | 0 1 1 2 2 3 |
|
40 | 0 1 1 2 2 3 | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | Examples that access the operating system work: |
|
43 | Examples that access the operating system work: | |
@@ -59,7 +59,7 b' def ipfunc():' | |||||
59 | In [7]: 'hi' |
|
59 | In [7]: 'hi' | |
60 | Out[7]: 'hi' |
|
60 | Out[7]: 'hi' | |
61 |
|
61 | |||
62 |
In [8]: print |
|
62 | In [8]: print(repr(_)) | |
63 | 'hi' |
|
63 | 'hi' | |
64 |
|
64 | |||
65 | In [7]: 3+4 |
|
65 | In [7]: 3+4 | |
@@ -135,7 +135,7 b' def iprand():' | |||||
135 | In [7]: 3+4 |
|
135 | In [7]: 3+4 | |
136 | Out[7]: 7 |
|
136 | Out[7]: 7 | |
137 |
|
137 | |||
138 |
In [8]: print |
|
138 | In [8]: print('hello') | |
139 | world # random |
|
139 | world # random | |
140 |
|
140 | |||
141 | In [9]: iprand() |
|
141 | In [9]: iprand() | |
@@ -152,13 +152,10 b' def iprand_all():' | |||||
152 | In [7]: 1 |
|
152 | In [7]: 1 | |
153 | Out[7]: 99 |
|
153 | Out[7]: 99 | |
154 |
|
154 | |||
155 |
In [8]: print |
|
155 | In [8]: print('hello') | |
156 | world |
|
156 | world | |
157 |
|
157 | |||
158 | In [9]: iprand_all() |
|
158 | In [9]: iprand_all() | |
159 | Out[9]: 'junk' |
|
159 | Out[9]: 'junk' | |
160 | """ |
|
160 | """ | |
161 | return 'iprand_all' |
|
161 | return 'iprand_all' | |
162 |
|
||||
163 |
|
||||
164 |
|
@@ -16,10 +16,10 b' def pyfunc():' | |||||
16 | 5 |
|
16 | 5 | |
17 |
|
17 | |||
18 | >>> for i in range(3): |
|
18 | >>> for i in range(3): | |
19 |
... print |
|
19 | ... print(i, end=' ') | |
20 |
... print |
|
20 | ... print(i+1, end=' ') | |
21 | ... |
|
21 | ... | |
22 | 0 1 1 2 2 3 |
|
22 | 0 1 1 2 2 3 | |
23 | """ |
|
23 | """ | |
24 | return 'pyfunc' |
|
24 | return 'pyfunc' | |
25 |
|
25 |
@@ -337,8 +337,8 b' class AssertPrints(object):' | |||||
337 | Examples |
|
337 | Examples | |
338 | -------- |
|
338 | -------- | |
339 | >>> with AssertPrints("abc", suppress=False): |
|
339 | >>> with AssertPrints("abc", suppress=False): | |
340 |
... print |
|
340 | ... print("abcd") | |
341 |
... print |
|
341 | ... print("def") | |
342 | ... |
|
342 | ... | |
343 | abcd |
|
343 | abcd | |
344 | def |
|
344 | def |
General Comments 0
You need to be logged in to leave comments.
Login now