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
>>> int('00000000', 2)
0: 0
>>> int('00000001', 2)
1: 1
>>> int('00000010', 2)
2: 2
>>> int('00000011', 2)
3: 3
>>> int('00000100', 2)
4: 4
>>> 2**7
5: 128
>>> int('10000000', 2)
6: 128
>>> int('01111111', 2)
7: 127
>>> int('11111111', 2)
8: 255
>>> int('65', 16)
9: 101
>>> int('EC', 16)
10: 236
>>> int('c4', 16)
11: 196
>>> int('9b', 16)
12: 155
>>> bin(196)
13: '0b11000100'
>>> bin(155)
14: '0b10011011'
>>> int('11011', 2)
15: 27
>>> 256 + 27
16: 283
>>> chr(283)
17: 'ě'
>>> print('123\rA')
A
>>> 6 / 3
18: 2.0
>>> 6 // 3
19: 2
>>> 7 // 3
20: 2
>>> 7 / 3
21: 2.3333333333333335
>>> 7 % 3
22: 1
>>> 6 % 3
23: 0
>>> (6 % 3) == 0
24: True
>>> 6 % 3 == 0
25: True
>>> 6 % (3 == 0)
Traceback (most recent call last):
File "<pyshell#27>", line 1, in <module>
6 % (3 == 0)
~~^~~~~~~~~~
ZeroDivisionError: integer modulo by zero
>>> 3 == 0
26: False
>>> True + True
27: 2
>>> (7 % 3) == 0
28: False
>>> 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]
>>> (7 % 3) == 0
29: False
>>> 7 % 3
30: 1
>>> (7 % 3) != 0
31: True
>>> for i in range(2, 101):
... if (i % 3) == 0 and (i % 7) == 0:
... print(i)
21
42
63
84
>>> for i in range(2, 101):
... if (i % 3) == 0 and (i % 7) != 0:
... print('3:', i)
... elif (i % 3) != 0 and (i % 7) == 0:
... print('7:', i)
3: 3
3: 6
7: 7
3: 9
3: 12
7: 14
3: 15
3: 18
3: 24
3: 27
7: 28
3: 30
3: 33
7: 35
3: 36
3: 39
3: 45
3: 48
7: 49
3: 51
3: 54
7: 56
3: 57
3: 60
3: 66
3: 69
7: 70
3: 72
3: 75
7: 77
3: 78
3: 81
3: 87
3: 90
7: 91
3: 93
3: 96
7: 98
3: 99
[About 38 more lines. Double-click to unfold]
>>> for i in range(2, 101):
... if (i % 3) == 0 and (i % 7) != 0:
... print(f'3: {i}')
... elif (i % 3) != 0 and (i % 7) == 0:
... print(f'7: {i}')
3: 3
3: 6
7: 7
3: 9
3: 12
7: 14
3: 15
3: 18
3: 24
3: 27
7: 28
3: 30
3: 33
7: 35
3: 36
3: 39
3: 45
3: 48
7: 49
3: 51
3: 54
7: 56
3: 57
3: 60
3: 66
3: 69
7: 70
3: 72
3: 75
7: 77
3: 78
3: 81
3: 87
3: 90
7: 91
3: 93
3: 96
7: 98
3: 99
[About 38 more lines. Double-click to unfold]
>>> import math
...
... math.factorial(5)
32: 120
>>> dir(math)
33: ['__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]
>>> 111 > math.inf
34: False
>>> 111 < math.inf
35: True
>>> 111 <= math.inf
36: True
>>> 111 >= math.inf
37: False
>>> dir('')
38: ['__add__',
'__class__',
'__contains__',
'__delattr__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__getitem__',
'__getnewargs__',
'__getstate__',
'__gt__',
'__hash__',
'__init__',
'__init_subclass__',
'__iter__',
'__le__',
'__len__',
'__lt__',
'__mod__',
'__mul__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__rmod__',
'__rmul__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'capitalize',
'casefold',
'center',
'count',
'encode',
'endswith',
'expandtabs',
'find',
'format',
'format_map',
'index',
'isalnum',
'isalpha',
'isascii',
'isdecimal',
'isdigit',
'isidentifier',
'islower',
'isnumeric',
'isprintable',
'isspace',
'istitle',
'isupper',
'join',
'ljust',
'lower',
'lstrip',
'maketrans',
'partition',
'removeprefix',
'removesuffix',
'replace',
'rfind',
'rindex',
'rjust',
'rpartition',
'rsplit',
'rstrip',
'split',
'splitlines',
'startswith',
'strip',
'swapcase',
'title',
'translate',
'upper',
'zfill']
[About 80 more lines. Double-click to unfold]
>>> print("Ahoj, Pavle,\njak se máš.")
Ahoj, Pavle,
jak se máš.
>>> print(r"Ahoj, Pavle,\njak se máš.")
Ahoj, Pavle,\njak se máš.
>>> xs = 'ABCDEF'
>>> type(xs)
39: <class 'str'>
>>> len(xs)
40: 6
>>> len('ABCČDĎEÉĚ')
41: 9
>>> xs
42: 'ABCDEF'
>>> xs[0]
43: 'A'
>>> xs[5]
44: 'F'
>>> xs[6]
Traceback (most recent call last):
File "<pyshell#54>", line 1, in <module>
xs[6]
~~^^^
IndexError: string index out of range
>>> xs[-1]
45: 'F'
>>> xs[-2]
46: 'E'
>>> xs[-6]
47: 'A'
>>> xs[-7]
Traceback (most recent call last):
File "<pyshell#58>", line 1, in <module>
xs[-7]
~~^^^^
IndexError: string index out of range
>>> xs
48: 'ABCDEF'
>>> xs[::2]
49: 'ACE'
>>> xs[::3]
50: 'AD'
>>> xs[:3]
51: 'ABC'
>>> xs[3:]
52: 'DEF'
>>> xs[2:5]
53: 'CDE'
>>> xs[2:5:2]
54: 'CE'
>>> 'A' in xs
55: True
>>> 'a' in xs
56: False
>>> 'BCD' in xs
57: True
>>> 'BCE' in xs
58: False
>>> xs
59: 'ABCDEF'
>>> xs * 3
60: 'ABCDEFABCDEFABCDEF'
>>> 3 * xs
61: 'ABCDEFABCDEFABCDEF'
>>> for x in 'ahoj':
... print(x)
a
h
o
j
>>> for x in sorted('ahoj'):
... print(x)
a
h
j
o
>>> for x in 'cello čelo':
... print(x)
c
e
l
l
o
č
e
l
o
>>> for x in sorted('cello čelo'):
... print(x)
c
e
e
l
l
l
o
o
č
>>> for x in 'ahoj':
... print(x)
a
h
o
j
>>> for x in sorted('ahoj'):
... print(x)
a
h
j
o
>>> for x in reversed('ahoj'):
... print(x)
j
o
h
a
>>> for x in enumerate('ahoj'):
... print(x)
(0, 'a')
(1, 'h')
(2, 'o')
(3, 'j')
>>> for x in enumerate('ahoj', 1):
... print(x)
(1, 'a')
(2, 'h')
(3, 'o')
(4, 'j')
>>> for x in enumerate('ahoj', start=1):
... print(x)
(1, 'a')
(2, 'h')
(3, 'o')
(4, 'j')
>>> for x in enumerate('ahoj', start=10):
... print(x)
(10, 'a')
(11, 'h')
(12, 'o')
(13, 'j')
>>> for i,x in enumerate('ahoj', start=10):
... print(x)
a
h
o
j
>>> for i,x in enumerate('ahoj', start=10):
... print(i)
10
11
12
13
>>> for i,x in enumerate('ahoj', start=10):
... print(x, i)
a 10
h 11
o 12
j 13
>>> for i,x in enumerate('ahoj', start=10):
... print(f'{i}: {x}')
10: a
11: h
12: o
13: j
>>> for x in enumerate('ahoj', start=10):
... print(x)
(10, 'a')
(11, 'h')
(12, 'o')
(13, 'j')
>>> for x in zip('abc', 'ABCD'):
... print(x)
('a', 'A')
('b', 'B')
('c', 'C')
>>> for x in zip('abc', 'ABCD', '12345'):
... print(x)
('a', 'A', '1')
('b', 'B', '2')
('c', 'C', '3')
>>> "Nesnesu se se sestrou.".index('se')
62: 8
>>> "Nesnesu se se sestrou.".index('si')
Traceback (most recent call last):
File "<pyshell#92>", line 1, in <module>
"Nesnesu se se sestrou.".index('si')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
ValueError: substring not found
>>> '12 to by nešlo 54'.strip('1234')
63: ' to by nešlo 5'
>>> '12 to by nešlo 54'.strip('1234 ')
64: 'to by nešlo 5'
>>> '12 to by nešlo 54'.strip('1 234')
65: 'to by nešlo 5'
>>> '12 to by nešlo 54'.strip('1 2534')
66: 'to by nešlo'
>>> ' \n to by nešlo 54'.strip()
67: 'to by nešlo 54'
>>> " Hello World, I am here. ".split()
68: ['Hello', 'World,', 'I', 'am', 'here.']
>>> ' '.join(" Hello World, I am here. ".split())
69: 'Hello World, I am here.'
>>> '|'.join(" Hello World, I am here. ".split())
70: 'Hello|World,|I|am|here.'
>>> chr(283)
71: 'ě'
>>> ord('ě')
72: 283
>>> xs = "Nesnesu se se sestrou."
>>> xs
73: 'Nesnesu se se sestrou.'
>>> len(xs)
74: 22
>>> 22 / 2
75: 11.0
>>> 22 // 2
76: 11
>>> len("Nesnesu se se sestrou.")
77: 23
>>> 23 / 2
78: 11.5
>>> 23 // 2
79: 11
>>> xs
80: 'Nesnesu se se sestrou.'
>>> xs[0:12]
81: 'Nesnesu se s'
>>> xs[0:len(xs) // 2 + 1]
82: 'Nesnesu se s'
>>> len(xs) // 2 + 1
83: 12
>>> xs[:len(xs) // 2 + 1]
84: 'Nesnesu se s'
>>> xs.find('u')
85: 6
>>> xs.index('u')
86: 6
>>> xs
87: 'Nesnesu se se sestrou.'
>>> xs[0:6]
88: 'Nesnes'
>>> xs[0:xs.index('u')]
89: 'Nesnes'
>>> xs[:xs.index('u')]
90: 'Nesnes'
>>> xs.count('e')
91: 5
>>> xs.count('n')
92: 1
>>> xs.count('N')
93: 1
>>> xs.count('N') + xs.count('n')
94: 2
>>>