mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 06:46:17 +00:00
Upd to python 3 in explicit code section
This commit is contained in:
@@ -65,9 +65,9 @@ it is bad practice to have two disjointed statements on the same line of code.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
print 'one'; print 'two'
|
print('one'); print('two')
|
||||||
|
|
||||||
if x == 1: print 'one'
|
if x == 1: print('one')
|
||||||
|
|
||||||
if <complex comparison> and <other complex comparison>:
|
if <complex comparison> and <other complex comparison>:
|
||||||
# do something
|
# do something
|
||||||
@@ -76,11 +76,11 @@ it is bad practice to have two disjointed statements on the same line of code.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
print 'one'
|
print('one')
|
||||||
print 'two'
|
print('two')
|
||||||
|
|
||||||
if x == 1:
|
if x == 1:
|
||||||
print 'one'
|
print('one')
|
||||||
|
|
||||||
cond1 = <complex comparison>
|
cond1 = <complex comparison>
|
||||||
cond2 = <other complex comparison>
|
cond2 = <other complex comparison>
|
||||||
|
|||||||
Reference in New Issue
Block a user