diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst --- a/Doc/tutorial/introduction.rst +++ b/Doc/tutorial/introduction.rst @@ -105,18 +105,18 @@ (-1+0j) >>> 1j * complex(0,1) (-1+0j) - >>> 3+1j*3 + >>> 3 + 1j * 3 (3+3j) - >>> (3+1j)*3 + >>> (3+1j) * 3 (9+3j) - >>> (1+2j)/(1+1j) + >>> (1+2j) / (1+1j) (1.5+0.5j) Complex numbers are always represented as two floating point numbers, the real and imaginary part. To extract these parts from a complex number *z*, use ``z.real`` and ``z.imag``. :: - >>> a=1.5+0.5j + >>> a = 1.5 + 0.5j >>> a.real 1.5 >>> a.imag @@ -127,7 +127,7 @@ correct way to convert a complex number to a real number. Use ``abs(z)`` to get its magnitude (as a float) or ``z.real`` to get its real part. :: - >>> a=3.0+4.0j + >>> a = 3.0 + 4.0j >>> float(a) Traceback (most recent call last): File "", line 1, in ? @@ -253,7 +253,7 @@ line above could also have been written ``word = 'Help' 'A'``; this only works with two literals, not with arbitrary string expressions:: - >>> 'str' 'ing' # <- This is ok + >>> 'str' 'ing' # <- This is ok 'string' >>> 'str'.strip() + 'ing' # <- This is ok 'string'