Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1795d6c commit be90648Copy full SHA for be90648
4 files changed
Doc/tutorial/controlflow.rst
@@ -61,7 +61,7 @@ they appear in the sequence. For example (no pun intended):
61
::
62
63
>>> # Measure some strings:
64
- ... words = ['cat', 'window', 'defenestrate']
+ >>> words = ['cat', 'window', 'defenestrate']
65
>>> for w in words:
66
... print(w, len(w))
67
...
@@ -445,7 +445,7 @@ boundary::
445
... print()
446
447
>>> # Now call the function we just defined:
448
- ... fib(2000)
+ >>> fib(2000)
449
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
450
451
.. index::
Doc/tutorial/datastructures.rst
@@ -383,16 +383,16 @@ A tuple consists of a number of values separated by commas, for instance::
383
>>> t
384
(12345, 54321, 'hello!')
385
>>> # Tuples may be nested:
386
- ... u = t, (1, 2, 3, 4, 5)
+ >>> u = t, (1, 2, 3, 4, 5)
387
>>> u
388
((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))
389
>>> # Tuples are immutable:
390
- ... t[0] = 88888
+ >>> t[0] = 88888
391
Traceback (most recent call last):
392
File "<stdin>", line 1, in <module>
393
TypeError: 'tuple' object does not support item assignment
394
>>> # but they can contain mutable objects:
395
- ... v = ([1, 2, 3], [3, 2, 1])
+ >>> v = ([1, 2, 3], [3, 2, 1])
396
>>> v
397
([1, 2, 3], [3, 2, 1])
398
@@ -465,7 +465,7 @@ Here is a brief demonstration::
465
False
466
467
>>> # Demonstrate set operations on unique letters from two words
468
- ...
+ >>>
469
>>> a = set('abracadabra')
470
>>> b = set('alacazam')
471
>>> a # unique letters in a
Doc/tutorial/inputoutput.rst
@@ -87,12 +87,12 @@ Some examples::
87
>>> print(s)
88
The value of x is 32.5, and y is 40000...
89
>>> # The repr() of a string adds string quotes and backslashes:
90
- ... hello = 'hello, world\n'
+ >>> hello = 'hello, world\n'
91
>>> hellos = repr(hello)
92
>>> print(hellos)
93
'hello, world\n'
94
>>> # The argument to repr() may be any Python object:
95
- ... repr((x, y, ('spam', 'eggs')))
+ >>> repr((x, y, ('spam', 'eggs')))
96
"(32.5, 40000, ('spam', 'eggs'))"
97
98
The :mod:`string` module contains a :class:`~string.Template` class that offers
Doc/tutorial/introduction.rst
@@ -501,8 +501,8 @@ together. For instance, we can write an initial sub-sequence of the
501
as follows::
502
503
>>> # Fibonacci series:
504
- ... # the sum of two elements defines the next
505
- ... a, b = 0, 1
+ >>> # the sum of two elements defines the next
+ >>> a, b = 0, 1
506
>>> while a < 10:
507
... print(a)
508
... a, b = b, a+b
0 commit comments