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 = "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,171 \n"
>>> xs
0: "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,171 \n"
>>> xs.rstrip('\n ')
1: "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,171"
>>> xs.rstrip(' \n')
2: "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,171"
>>> xs.rstrip(' \n').lstrip('0123456789ab;')
3: "Philosopher's Stone;2001;Chris Columbus;$1,006,968,171"
>>> xs.strip('0123456789ab; \n')
4: "Philosopher's Stone;2001;Chris Columbus;$1,006,968,"
>>> xs.rstrip(' \n0123456789').lstrip('0123456789ab;')
5: "Philosopher's Stone;2001;Chris Columbus;$1,006,968,"
>>> xs.rstrip(' \n0123456789')
6: "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,"
>>> xs.rstrip(' \n,0123456789')
7: "1;Philosopher's Stone;2001;Chris Columbus;$"
>>> xs.rstrip(' \n,0123456789$')
8: "1;Philosopher's Stone;2001;Chris Columbus;"
>>> xs.rstrip(' \n')
9: "1;Philosopher's Stone;2001;Chris Columbus;$1,006,968,171"
>>> xs.rstrip(' \n').split(';')
10: ['1', "Philosopher's Stone", '2001', 'Chris Columbus', '$1,006,968,171']
>>> '$1,006,968,171' < '$797,361,618'
11: True
>>> '$1,006,968,171' < '$797,361,6189'
12: True
>>> '$1,006,968,171' < '$9,797,361,618'
13: True
>>> int('$797,361,618')
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
int('$797,361,618')
~~~^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '$797,361,618'
>>> int('797,361,618')
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
int('797,361,618')
~~~^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '797,361,618'
>>> int('797_361_618')
14: 797361618
>>> int('797361618')
15: 797361618
>>> '$797,361,618'.strip('$')
16: '797,361,618'
>>> '$797,361,618'[1:]
17: '797,361,618'
>>> '$797,361,618'.strip('$')
18: '797,361,618'
>>> '$797,361,618'.strip('$').replace(',', '_')
19: '797_361_618'
>>> '$797,361,618'.strip('$').replace(',', '')
20: '797361618'
>>> int(
... '$797,361,618'.strip('$').replace(',', '_')
... )
21: 797361618
>>> [1, print, 'abc']
22: [1, <built-in function print>, 'abc']
>>> [1, print(), 'abc']
23: [1, None, 'abc']
>>> [1, print(123), 'abc']
123
24: [1, None, 'abc']
>>> xs = [1, print, 'abc']
>>> xs
25: [1, <built-in function print>, 'abc']
>>> xs[1]
26: <built-in function print>
>>> xs[1]()
>>> xs[1](123)
123
>>> xs = 'Ahoj!'
>>> for znak in xs:
... print(znak)
A
h
o
j
!
>>> it = iter(xs)
>>> for znak in it:
... print(znak)
A
h
o
j
!
>>> for znak in it:
... print(znak)
>>> it = iter(xs)
>>> for znak in it:
... print(znak)
A
h
o
j
!
>>> for znak in it:
... print(znak)
>>> it = iter(xs)
>>> next(it)
27: 'A'
>>> next(it)
28: 'h'
>>> next(it)
29: 'o'
>>> next(it)
30: 'j'
>>> next(it)
31: '!'
>>> next(it)
Traceback (most recent call last):
File "<pyshell#47>", line 1, in <module>
next(it) # vrať další prvek z iterátoru
~~~~^^^^
StopIteration
>>> next(it)
Traceback (most recent call last):
File "<pyshell#48>", line 1, in <module>
next(it) # vrať další prvek z iterátoru
~~~~^^^^
StopIteration
>>> it = iter(xs)
>>> next(it)
32: 'A'
>>> next(it)
33: 'h'
>>> for znak in it:
... print(znak)
o
j
!
>>> next(it)
Traceback (most recent call last):
File "<pyshell#53>", line 1, in <module>
next(it) # vrať další prvek z iterátoru
~~~~^^^^
StopIteration
>>> xs = "text nezáživný obsahující slov vybraných několik"
>>> xs
34: 'text nezáživný obsahující slov vybraných několik'
>>> xs.split(' ')
35: ['text', 'nezáživný', 'obsahující', 'slov', 'vybraných', 'několik']
>>> 'obsahující'.count('o')
36: 1
>>> 'obsahující'.count('a')
37: 1
>>> 'obsahující'.count('u')
38: 1
>>> 'obsahující'.count('í')
39: 2
>>> 'obsahující'.count('í') + 'obsahující'.count('u')
40: 3
>>>