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 >>> bin(127) 0: '0b1111111' >>> oct(127) 1: '0o177' >>> hex(127) 2: '0x7f' >>> hex(128) 3: '0x80' >>> řádka = "Harry Potter and the Philosopher's Stone\n" >>> řádka 4: "Harry Potter and the Philosopher's Stone\n" >>> řádka - řádka.strip() Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> řádka - řádka.strip() ~~~~~~^~~~~~~~~~~~~~~ TypeError: unsupported operand type(s) for -: 'str' and 'str' >>> řádka = řádka.strip() >>> řádka 5: "Harry Potter and the Philosopher's Stone" >>> řádka = řádka.split(';') >>> řádka 6: ["Harry Potter and the Philosopher's Stone"] >>> název = "Harry Potter and the Philosopher's Stone\n" >>> název = název.rstrip() >>> název 7: "Harry Potter and the Philosopher's Stone" >>> podnázev = "Harry Potter and the " >>> podnázev 8: 'Harry Potter and the ' >>> len(podnázev) 9: 21 >>> název[21:] 10: "Philosopher's Stone" >>> xs = [1, 'a', print, 2, 3, 'bc'] >>> len(xs) 11: 6 >>> type(xs) 12: <class 'list'> >>> dir(xs) 13: ['__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] >>> xs 14: [1, 'a', <built-in function print>, 2, 3, 'bc'] >>> xs[0] 15: 1 >>> xs[1] 16: 'a' >>> xs[-1] 17: 'bc' >>> xs[2] 18: <built-in function print> >>> xs[2] = 666 >>> xs 19: [1, 'a', 666, 2, 3, 'bc'] >>> 'a' in xs 20: True >>> 'b' in xs 21: False >>> 'b' not in xs 22: True >>> xs*2 23: [1, 'a', 666, 2, 3, 'bc', 1, 'a', 666, 2, 3, 'bc'] >>> 2*xs 24: [1, 'a', 666, 2, 3, 'bc', 1, 'a', 666, 2, 3, 'bc'] >>> for x in xs: ... print(x) 1 a 666 2 3 bc >>> for x in reversed(xs): ... print(x) bc 3 2 666 a 1 >>> for x in sorted(xs): ... print(x) Traceback (most recent call last): File "<pyshell#36>", line 1, in <module> for x in sorted(xs): ~~~~~~^^^^ TypeError: '<' not supported between instances of 'str' and 'int' >>> xs 25: [1, 'a', 666, 2, 3, 'bc'] >>> for x in enumerate(xs): ... print(x) (0, 1) (1, 'a') (2, 666) (3, 2) (4, 3) (5, 'bc') >>> for x in enumerate(xs, start=10): ... print(x) (10, 1) (11, 'a') (12, 666) (13, 2) (14, 3) (15, 'bc') >>> for i,x in enumerate(xs, start=10): ... print(f'{i}) {x}') 10) 1 11) a 12) 666 13) 2 14) 3 15) bc >>> xs 26: [1, 'a', 666, 2, 3, 'bc'] >>> xs[::-1] 27: ['bc', 3, 2, 666, 'a', 1] >>> xs 28: [1, 'a', 666, 2, 3, 'bc'] >>> xs.append(456) >>> xs 29: [1, 'a', 666, 2, 3, 'bc', 456] >>> ys = [] >>> ys 30: [] >>> ys = list() >>> ys 31: [] >>> ys.append(123) >>> ys 32: [123] >>> ys.append(456) >>> ys 33: [123, 456] >>> ys.insert(0, 'abc') >>> ys 34: ['abc', 123, 456] >>> ys.insert(1, 'DEF') >>> ys 35: ['abc', 'DEF', 123, 456] >>> xs = 'ahoj' >>> xs[1] 36: 'h' >>>