Python 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.2.1
>>> xs = " Hello World, I am here. "
>>> xs.split()
0: ['Hello', 'World,', 'I', 'am', 'here.']
>>> '_'.join(xs.split())
1: 'Hello_World,_I_am_here.'
>>> xs.split()
2: ['Hello', 'World,', 'I', 'am', 'here.']
>>> xs.split()[::-1]
3: ['here.', 'am', 'I', 'World,', 'Hello']
>>> ' '.join((xs.split()[::-1]))
4: 'here. am I World, Hello'
>>> 8 / 2
5: 4.0
>>> 8 // 2
6: 4
>>> 9 / 2
7: 4.5
>>> 9 // 2
8: 4
>>> 4.2 % 2
9: 0.20000000000000018
>>> xs = ['číro', 'cimbál', 'deska', 'ahoj', ]
>>> for x in xs:
... print(x)
číro
cimbál
deska
ahoj
>>> dir(xs)
10: ['__add__',
'__class__',
'__class_getitem__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getstate__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort']
[About 47 more lines. Double-click to unfold]
>>> for x in enumerate(xs):
... print(x)
(0, 'číro')
(1, 'cimbál')
(2, 'deska')
(3, 'ahoj')
>>> for x in enumerate(xs, start=1):
... print(x)
(1, 'číro')
(2, 'cimbál')
(3, 'deska')
(4, 'ahoj')
>>> for x in enumerate(xs, 1):
... print(x)
(1, 'číro')
(2, 'cimbál')
(3, 'deska')
(4, 'ahoj')
>>> for (i,x) in enumerate(xs, 1):
... print(x, i)
číro 1
cimbál 2
deska 3
ahoj 4
>>> for i,x in enumerate(xs, 1):
... print(x, i)
číro 1
cimbál 2
deska 3
ahoj 4
>>> for x in reversed(xs):
... print(x)
ahoj
deska
cimbál
číro
>>> xs
11: ['číro', 'cimbál', 'deska', 'ahoj']
>>> for x in sorted(xs):
... print(x)
ahoj
cimbál
deska
číro
>>> 'číro' < 'ahoj'
12: False
>>> 'číro' > 'ahoj'
13: True
>>> 'číro'.__lt__('ahoj')
14: False
>>> 'číro'.__gt__('ahoj')
15: True
>>> dir(xs)
16: ['__add__',
'__class__',
'__class_getitem__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getstate__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort']
[About 47 more lines. Double-click to unfold]
>>> dir(1)
17: ['__abs__',
'__add__',
'__and__',
'__bool__',
'__ceil__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floor__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getnewargs__',
'__getstate__',
'__gt__',
'__hash__',
'__index__',
'__init__',
'__init_subclass__',
'__int__',
'__invert__',
'__le__',
'__lshift__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__or__',
'__pos__',
'__pow__',
'__radd__',
'__rand__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rlshift__',
'__rmod__',
'__rmul__',
'__ror__',
'__round__',
'__rpow__',
'__rrshift__',
'__rshift__',
'__rsub__',
'__rtruediv__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'__trunc__',
'__xor__',
'as_integer_ratio',
'bit_count',
'bit_length',
'conjugate',
'denominator',
'from_bytes',
'imag',
'is_integer',
'numerator',
'real',
'to_bytes']
[About 73 more lines. Double-click to unfold]
>>> 1 + 2
18: 3
>>> (1).__add__(2)
19: 3
>>> (2).__radd__(1)
20: 3
>>> x = 1
>>> '''x++'''
21: 'x++'
>>> x = x + 1
>>> x
22: 2
>>> x += 1
>>> x
23: 3
>>> dir()
24: ['_',
'_0',
'_1',
'_10',
'_11',
'_12',
'_13',
'_14',
'_15',
'_16',
'_17',
'_18',
'_19',
'_2',
'_20',
'_21',
'_22',
'_23',
'_3',
'_4',
'_5',
'_6',
'_7',
'_8',
'_9',
'__',
'___',
'__builtins__',
'__doc__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'i',
'x',
'xs']
[About 35 more lines. Double-click to unfold]
>>> y
Traceback (most recent call last):
File "<pyshell#38>", line 1, in <module>
y
NameError: name 'y' is not defined
>>> for y in 'ahoj':
... ...
25: Ellipsis
>>> y
26: 'j'
>>> del y
>>> y
Traceback (most recent call last):
File "<pyshell#42>", line 1, in <module>
y
NameError: name 'y' is not defined
>>> for y in 'ahoj':
... ...
... del y
27: Ellipsis
>>> y
Traceback (most recent call last):
File "<pyshell#44>", line 1, in <module>
y
NameError: name 'y' is not defined
>>> locals()
28: {'_': Ellipsis,
'_0': ['Hello', 'World,', 'I', 'am', 'here.'],
'_1': 'Hello_World,_I_am_here.',
'_10': ['__add__',
'__class__',
'__class_getitem__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getstate__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort'],
'_11': ['číro', 'cimbál', 'deska', 'ahoj'],
'_12': False,
'_13': True,
'_14': False,
'_15': True,
'_16': ['__add__',
'__class__',
'__class_getitem__',
'__contains__',
'__delattr__',
'__delitem__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getstate__',
'__gt__',
'__hash__',
'__iadd__',
'__imul__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__reversed__',
'__rmul__',
'__setattr__',
'__setitem__',
'__sizeof__',
'__str__',
'__subclasshook__',
'append',
'clear',
'copy',
'count',
'extend',
'index',
'insert',
'pop',
'remove',
'reverse',
'sort'],
'_17': ['__abs__',
'__add__',
'__and__',
'__bool__',
'__ceil__',
'__class__',
'__delattr__',
'__dir__',
'__divmod__',
'__doc__',
'__eq__',
'__float__',
'__floor__',
'__floordiv__',
'__format__',
'__ge__',
'__getattribute__',
'__getnewargs__',
'__getstate__',
'__gt__',
'__hash__',
'__index__',
'__init__',
'__init_subclass__',
'__int__',
'__invert__',
'__le__',
'__lshift__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__neg__',
'__new__',
'__or__',
'__pos__',
'__pow__',
'__radd__',
'__rand__',
'__rdivmod__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rfloordiv__',
'__rlshift__',
'__rmod__',
'__rmul__',
'__ror__',
'__round__',
'__rpow__',
'__rrshift__',
'__rshift__',
'__rsub__',
'__rtruediv__',
'__rxor__',
'__setattr__',
'__sizeof__',
'__str__',
'__sub__',
'__subclasshook__',
'__truediv__',
'__trunc__',
'__xor__',
'as_integer_ratio',
'bit_count',
'bit_length',
'conjugate',
'denominator',
'from_bytes',
'imag',
'is_integer',
'numerator',
'real',
'to_bytes'],
'_18': 3,
'_19': 3,
'_2': ['Hello', 'World,', 'I', 'am', 'here.'],
'_20': 3,
'_21': 'x++',
'_22': 2,
'_23': 3,
'_24': ['_',
'_0',
'_1',
'_10',
'_11',
'_12',
'_13',
'_14',
'_15',
'_16',
'_17',
'_18',
'_19',
'_2',
'_20',
'_21',
'_22',
'_23',
'_3',
'_4',
'_5',
'_6',
'_7',
'_8',
'_9',
'__',
'___',
'__builtins__',
'__doc__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'i',
'x',
'xs'],
'_25': Ellipsis,
'_26': 'j',
'_27': Ellipsis,
'_3': ['here.', 'am', 'I', 'World,', 'Hello'],
'_4': 'here. am I World, Hello',
'_5': 4.0,
'_6': 4,
'_7': 4.5,
'_8': 4,
'_9': 0.20000000000000018,
'__': 'j',
'___': Ellipsis,
'__builtins__': {'ArithmeticError': <class 'ArithmeticError'>,
'AssertionError': <class 'AssertionError'>,
'AttributeError': <class 'AttributeError'>,
'BaseException': <class 'BaseException'>,
'BaseExceptionGroup': <class 'BaseExceptionGroup'>,
'BlockingIOError': <class 'BlockingIOError'>,
'BrokenPipeError': <class 'BrokenPipeError'>,
'BufferError': <class 'BufferError'>,
'BytesWarning': <class 'BytesWarning'>,
'ChildProcessError': <class 'ChildProcessError'>,
'ConnectionAbortedError': <class 'ConnectionAbortedError'>,
'ConnectionError': <class 'ConnectionError'>,
'ConnectionRefusedError': <class 'ConnectionRefusedError'>,
'ConnectionResetError': <class 'ConnectionResetError'>,
'DeprecationWarning': <class 'DeprecationWarning'>,
'EOFError': <class 'EOFError'>,
'Ellipsis': Ellipsis,
'EncodingWarning': <class 'EncodingWarning'>,
'EnvironmentError': <class 'OSError'>,
'Exception': <class 'Exception'>,
'ExceptionGroup': <class 'ExceptionGroup'>,
'False': False,
'FileExistsError': <class 'FileExistsError'>,
'FileNotFoundError': <class 'FileNotFoundError'>,
'FloatingPointError': <class 'FloatingPointError'>,
'FutureWarning': <class 'FutureWarning'>,
'GeneratorExit': <class 'GeneratorExit'>,
'IOError': <class 'OSError'>,
'ImportError': <class 'ImportError'>,
'ImportWarning': <class 'ImportWarning'>,
'IndentationError': <class 'IndentationError'>,
'IndexError': <class 'IndexError'>,
'InterruptedError': <class 'InterruptedError'>,
'IsADirectoryError': <class 'IsADirectoryError'>,
'KeyError': <class 'KeyError'>,
'KeyboardInterrupt': <class 'KeyboardInterrupt'>,
'LookupError': <class 'LookupError'>,
'MemoryError': <class 'MemoryError'>,
'ModuleNotFoundError': <class 'ModuleNotFoundError'>,
'NameError': <class 'NameError'>,
'None': None,
'NotADirectoryError': <class 'NotADirectoryError'>,
'NotImplemented': NotImplemented,
'NotImplementedError': <class 'NotImplementedError'>,
'OSError': <class 'OSError'>,
'OverflowError': <class 'OverflowError'>,
'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>,
'PermissionError': <class 'PermissionError'>,
'ProcessLookupError': <class 'ProcessLookupError'>,
'PythonFinalizationError': <class 'PythonFinalizationError'>,
'RecursionError': <class 'RecursionError'>,
'ReferenceError': <class 'ReferenceError'>,
'ResourceWarning': <class 'ResourceWarning'>,
'RuntimeError': <class 'RuntimeError'>,
'RuntimeWarning': <class 'RuntimeWarning'>,
'StopAsyncIteration': <class 'StopAsyncIteration'>,
'StopIteration': <class 'StopIteration'>,
'SyntaxError': <class 'SyntaxError'>,
'SyntaxWarning': <class 'SyntaxWarning'>,
'SystemError': <class 'SystemError'>,
'SystemExit': <class 'SystemExit'>,
'TabError': <class 'TabError'>,
'TimeoutError': <class 'TimeoutError'>,
'True': True,
'TypeError': <class 'TypeError'>,
'UnboundLocalError': <class 'UnboundLocalError'>,
'UnicodeDecodeError': <class 'UnicodeDecodeError'>,
'UnicodeEncodeError': <class 'UnicodeEncodeError'>,
'UnicodeError': <class 'UnicodeError'>,
'UnicodeTranslateError': <class 'UnicodeTranslateError'>,
'UnicodeWarning': <class 'UnicodeWarning'>,
'UserWarning': <class 'UserWarning'>,
'ValueError': <class 'ValueError'>,
'Warning': <class 'Warning'>,
'WindowsError': <class 'OSError'>,
'ZeroDivisionError': <class 'ZeroDivisionError'>,
'_IncompleteInputError': <class '_IncompleteInputError'>,
'__build_class__': <built-in function __build_class__>,
'__debug__': True,
'__doc__': 'Built-in functions, types, exceptions, and other '
'objects.\n'
'\n'
'This module provides direct access to all '
"'built-in'\n"
'identifiers of Python; for example, builtins.len '
'is\n'
'the full name for the built-in function len().\n'
'\n'
'This module is not normally accessed explicitly '
'by most\n'
'applications, but can be useful in modules that '
'provide\n'
'objects with the same name as a built-in value, '
'but in\n'
'which the built-in of that name is also needed.',
'__import__': <built-in function __import__>,
'__loader__': <class '_frozen_importlib.BuiltinImporter'>,
'__name__': 'builtins',
'__package__': '',
'__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'),
'abs': <built-in function abs>,
'aiter': <built-in function aiter>,
'all': <built-in function all>,
'anext': <built-in function anext>,
'any': <built-in function any>,
'ascii': <built-in function ascii>,
'bin': <built-in function bin>,
'bool': <class 'bool'>,
'breakpoint': <built-in function breakpoint>,
'bytearray': <class 'bytearray'>,
'bytes': <class 'bytes'>,
'callable': <built-in function callable>,
'chr': <built-in function chr>,
'classmethod': <class 'classmethod'>,
'compile': <built-in function compile>,
'complex': <class 'complex'>,
'delattr': <built-in function delattr>,
'dict': <class 'dict'>,
'dir': <built-in function dir>,
'divmod': <built-in function divmod>,
'enumerate': <class 'enumerate'>,
'eval': <built-in function eval>,
'exec': <built-in function exec>,
'exit': Press Ctrl-Q or close the window if you want to quit DreamPie.
Press Ctrl-F6 if you want to restart the subprocess.,
'filter': <class 'filter'>,
'float': <class 'float'>,
'format': <built-in function format>,
'frozenset': <class 'frozenset'>,
'getattr': <built-in function getattr>,
'globals': <built-in function globals>,
'hasattr': <built-in function hasattr>,
'hash': <built-in function hash>,
'hex': <built-in function hex>,
'id': <built-in function id>,
'input': <built-in function input>,
'int': <class 'int'>,
'isinstance': <built-in function isinstance>,
'issubclass': <built-in function issubclass>,
'iter': <built-in function iter>,
'len': <built-in function len>,
'list': <class 'list'>,
'locals': <built-in function locals>,
'map': <class 'map'>,
'max': <built-in function max>,
'memoryview': <class 'memoryview'>,
'min': <built-in function min>,
'next': <built-in function next>,
'object': <class 'object'>,
'oct': <built-in function oct>,
'open': <built-in function open>,
'ord': <built-in function ord>,
'pow': <built-in function pow>,
'print': <built-in function print>,
'property': <class 'property'>,
'quit': Press Ctrl-Q or close the window if you want to quit DreamPie.
Press Ctrl-F6 if you want to restart the subprocess.,
'range': <class 'range'>,
'repr': <built-in function repr>,
'reversed': <class 'reversed'>,
'round': <built-in function round>,
'set': <class 'set'>,
'setattr': <built-in function setattr>,
'slice': <class 'slice'>,
'sorted': <built-in function sorted>,
'staticmethod': <class 'staticmethod'>,
'str': <class 'str'>,
'sum': <built-in function sum>,
'super': <class 'super'>,
'tuple': <class 'tuple'>,
'type': <class 'type'>,
'vars': <built-in function vars>,
'zip': <class 'zip'>},
'__doc__': None,
'__loader__': None,
'__name__': '__main__',
'__package__': None,
'__spec__': None,
'i': 4,
'x': 3,
'xs': ['číro', 'cimbál', 'deska', 'ahoj']}
[About 413 more lines. Double-click to unfold]
>>> abs(-3)
29: 3
>>> import math
>>> dir(math)
30: ['__doc__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'acos',
'acosh',
'asin',
'asinh',
'atan',
'atan2',
'atanh',
'cbrt',
'ceil',
'comb',
'copysign',
'cos',
'cosh',
'degrees',
'dist',
'e',
'erf',
'erfc',
'exp',
'exp2',
'expm1',
'fabs',
'factorial',
'floor',
'fma',
'fmod',
'frexp',
'fsum',
'gamma',
'gcd',
'hypot',
'inf',
'isclose',
'isfinite',
'isinf',
'isnan',
'isqrt',
'lcm',
'ldexp',
'lgamma',
'log',
'log10',
'log1p',
'log2',
'modf',
'nan',
'nextafter',
'perm',
'pi',
'pow',
'prod',
'radians',
'remainder',
'sin',
'sinh',
'sqrt',
'sumprod',
'tan',
'tanh',
'tau',
'trunc',
'ulp']
[About 66 more lines. Double-click to unfold]
>>> factorial(3)
Traceback (most recent call last):
File "<pyshell#49>", line 1, in <module>
factorial(3)
^^^^^^^^^
NameError: name 'factorial' is not defined
>>> math.factorial(3)
31: 6
>>> list(range(100))
32: [0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99]
[About 99 more lines. Double-click to unfold]
>>> list(range(101))[-1]
33: 100
>>> list(range(100))[-1]
34: 99
>>> range(101)
35: range(0, 101)
>>> range(3, 11)
36: range(3, 11)
>>> list(range(3, 11))
37: [3, 4, 5, 6, 7, 8, 9, 10]
>>> list(range(3, 11, 2))
38: [3, 5, 7, 9]
>>> for i in range(2, 101):
... if i % 3 == 0 or i % 7 == 0:
... print(i)
3
6
7
9
12
14
15
18
21
24
27
28
30
33
35
36
39
42
45
48
49
51
54
56
57
60
63
66
69
70
72
75
77
78
81
84
87
90
91
93
96
98
99
[About 42 more lines. Double-click to unfold]
>>> for i in range(2, 101):
... if i % 3 == 0 or i % 7 == 0:
... print(i, end=' ')
3 6 7 9 12 14 15 18 21 24 27 28 30 33 35 36 39 42 45 48 49 51 54 56 57 60 63 66 69 70 72 75 77 78 81 84 87 90 91 93 96 98 99
>>> for i in range(2, 101):
... if (i % 3 == 0) or (i % 7 == 0):
... print(i, end=' ')
3 6 7 9 12 14 15 18 21 24 27 28 30 33 35 36 39 42 45 48 49 51 54 56 57 60 63 66 69 70 72 75 77 78 81 84 87 90 91 93 96 98 99
>>> (77 % 3 == 0), (77 % 7 == 0)
39: (False, True)
>>> 77 % 3 == 0, 77 % 7 == 0
40: (False, True)
>>> (6, 5) == (4, 7)
41: False
>>> 6, 5 == 4, 7
42: (6, False, 7)
>>> if (False, []):
... print('Baf!')
Baf!
>>> if ():
... print('Baf!')
>>> type(())
43: <class 'tuple'>
>>> for x in 'abc':
... print(x)
a
b
c
>>> for x in 'abc': print(x)
a
b
c
>>> for x in 'abc': print(x); print('Baf!')
a
Baf!
b
Baf!
c
Baf!
>>> for i in range(10):
... print(i, end=' ')
... else:
... print('Konec!')
0 1 2 3 4 5 6 7 8 9 Konec!
>>> for i in range(10):
... print(i, end=' ')
... if i == 5: break
... else:
... print('Konec!')
0 1 2 3 4 5
>>> xs = 'Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666'
>>> len(xs)
44: 5
>>> type(xs)
45: <class 'tuple'>
>>> xs[0]
46: 'Ahoj!'
>>> xs[-1]
47: 'lokus 666'
>>> xs[::-1]
48: ('lokus 666', ['hokus', 'pokus'], (12, 'tři'), 123, 'Ahoj!')
>>> xs[2]
49: (12, 'tři')
>>> xs[2][::-1]
50: ('tři', 12)
>>> xs[2][1]
51: 'tři'
>>> 123 in xs
52: True
>>> dir(xs)
53: ['__add__',
'__class__',
'__class_getitem__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getnewargs__',
'__getstate__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmul__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'count',
'index']
[About 34 more lines. Double-click to unfold]
>>> 123 in xs
54: True
>>> xs.__contains__(123)
55: True
>>> xs
56: ('Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666')
>>> xs[1]
57: 123
>>> xs[1] = 321
Traceback (most recent call last):
File "<pyshell#88>", line 1, in <module>
xs[1] = 321
~~^^^
TypeError: 'tuple' object does not support item assignment
>>> xs[2]
58: (12, 'tři')
>>> xs[2][0]
59: 12
>>> xs[2][0] = 21
Traceback (most recent call last):
File "<pyshell#91>", line 1, in <module>
xs[2][0] = 21
~~~~~^^^
TypeError: 'tuple' object does not support item assignment
>>> xs[3]
60: ['hokus', 'pokus']
>>> xs
61: ('Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666')
>>> xs[3]
62: ['hokus', 'pokus']
>>> xs[3][0]
63: 'hokus'
>>> xs[3][0] = 666
>>> xs
64: ('Ahoj!', 123, (12, 'tři'), [666, 'pokus'], 'lokus 666')
>>> hash( 'Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666' )
Traceback (most recent call last):
File "<pyshell#98>", line 1, in <module>
hash( 'Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666' )
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: hash() takes exactly one argument (5 given)
>>> hash( ('Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666') )
Traceback (most recent call last):
File "<pyshell#99>", line 1, in <module>
hash( ('Ahoj!', 123, (12, 'tři'), ['hokus', 'pokus'], 'lokus 666') )
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'list'
>>> hash( ('Ahoj!', 123, (12, 'tři'), ('hokus', 'pokus'), 'lokus 666') )
65: -4561956068059026582
>>> a, b = 2, 3
>>> a
66: 2
>>> b
67: 3
>>> a, b = b, a
>>> a
68: 3
>>> b
69: 2
>>> a, b, c = 'abc'
>>> a
70: 'a'
>>> b
71: 'b'
>>> c
72: 'c'
>>> a, b, c = 'první', 1, 2, 'ahoj', 'poslední'
Traceback (most recent call last):
File "<pyshell#111>", line 1, in <module>
a, b, c = 'první', 1, 2, 'ahoj', 'poslední'
^^^^^^^
ValueError: too many values to unpack (expected 3)
>>> a, *b, c = 'první', 1, 2, 'ahoj', 'poslední'
>>> a
73: 'první'
>>> c
74: 'poslední'
>>> b
75: [1, 2, 'ahoj']
>>> *a, b, c = 'první', 1, 2, 'ahoj', 'poslední'
>>> a
76: ['první', 1, 2]
>>> b
77: 'ahoj'
>>> c
78: 'poslední'
>>> a, b, *c = 'první', 1, 2, 'ahoj', 'poslední'
>>> ab
Traceback (most recent call last):
File "<pyshell#121>", line 1, in <module>
ab
NameError: name 'ab' is not defined
>>> a
79: 'první'
>>> b
80: 1
>>> c
81: [2, 'ahoj', 'poslední']
>>> a, b, *_ = 'první', 1, 2, 'ahoj', 'poslední'
>>> _
82: [2, 'ahoj', 'poslední']
>>> a, b, *c = 'první', 1
>>> a, b, c = 'první', 1
Traceback (most recent call last):
File "<pyshell#128>", line 1, in <module>
a, b, c = 'první', 1
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)
>>> a, b, *c = 'první', 1
>>> c
83: []
>>> print([1,2,3])
[1, 2, 3]
>>> print([1,2,3], sep='|')
[1, 2, 3]
>>> print(*[1,2,3])
1 2 3
>>> print(*[1,2,3], sep='|')
1|2|3
>>> for x in 'ahoj':
... pass
>>> for x in 'ahoj':
... ...
84: Ellipsis
>>> ...
85: Ellipsis
>>>