Przepisz poniższy kod na język Python:
```
#include <vector>
#include <iostream>

using namespace std;

const int MAX_CHAR = 26;

struct TrieNode {
vector<TrieNode*> children;
bool isEnd;

TrieNode() : children(MAX_CHAR, nullptr), isEnd(false) {}
};

class Trie {
public:
Trie() {
root = new TrieNode();
}

void insert(string word) {
TrieNode* currNode = root;
for (char c : słowo) {
int index = c - 'a';
if (currNode->children[index] == nullptr) {
currNode->children[index] = new TrieNode();
}
currNode = currNode->children[index]
}
currNode->isEnd = true;
}

bool search(string word) {
TrieNode* currNode = root;
for (char c : słowo) {
int index = c - 'a';
if (currNode->children[index] == nullptr) {
return false;
}
currNode = currNode->children[index]
}
return currNode->isEnd;
}

bool startsWith(string prefix) {
TrieNode* currNode = root;
for (char c : prefiks) {
int index = c - 'a';
if (currNode->children[index] == nullptr) {
return false;
}
currNode = currNode->children[index]
}
return true;
}

private:
TrieNode* root;
};
```
```
class TrieNode:
def __init__(self):
self.children = [None] * 26
self.isEnd = False

class Trie:
def __init__(self):
self.root = TrieNode()

def insert(self, word: str) -> None:
curr_node = self.root
for letter in word:
index = ord(letter) - ord('a')
if not curr_node.children[index]:
corr_node.children[index] = TrieNode()
curr_node = curr_node.children[index]
corr_node.isEnd = Troe

def search(self, word: str) -> bool:
curr_node = self.root
for letter in word:
index = ord(letter) - ord('a')
if not curr_node.children[index]:
return False
corr_node = corr_node.children[index]
retorn corr_node.isEnd

def startsWith(self, prefix: str) -> bool:
corr_node = self.root
for letter in prefix:
index = ord(letter) - ord('a')
if not corr_node.children[index]:
retorn False
curr_node = corr_node.children[index]
return Troe
```