[Norvig] So now I'm ready to tackle the main function, poker.
And we said it takes as input a list of hands,
and it's going to return the best hand.
So it takes as input the list, returns the best hand.
I haven't quite figured out how to write the function itself,
but at least I've got the prototype going.
Now, out of a list of hands we want poker to return the highest ranking hand.
Do we know of something that will help us do that? Think about it.
Do you know of a built-in function in Python that selects the highest ranking item from a list?
If you do, go ahead and give its name.
[Norvig] OK, więc jestem gotów, by zmierzyć się z naszą główną funkcją - poker.
Powiedzielismy, że bierze ona na wejsciu listę rąk pokerowych
i zwraca najlepszą z nich.
Tak więc lista jako dane wejsciowe - najlepszy układ jako rezultat.
Nie wpadłem jeszcze na to, jak dokładnie napisać naszą funkcję,
ale mam przynajmniej zarys prototypu.
Chcemy, żeby funkcja poker zwracała najlepszą rękę na podstawie listy wejsciowej.
Czy wiemy cos, co mogłoby nam pomóc? Pomyslcie o tym.
Czy znacie wbudowaną funkcję Pythona, która wybiera z listy element o najwyższej wartosci?
Jeśli znacie, podajcie jej nazwę.
[Norvig] Então agora estou pronto para resolver a função principal, poker.
E nós dissemos que ela toma como entrada uma lista de mãos,
e vai retornar a melhor mão.
Por isso, toma como entrada a lista e retorna a melhor mão.
Eu não percebi bem como escrever a própria função,
mas pelo menos eu tenho o protótipo acontecendo.
Agora, a partir de uma lista de mãos, nós queremos que o poker retorne a melhor mão classificada.
Nós sabemos de algo que vai nos ajudar a fazer isso? Pense sobre isso.
Você sabe de uma função embutida em Python que seleciona o item de maior ranking de uma lista?
Se você sabe, vá em frente e dê o seu nome.
Então agora eu estou pronto para
abordar a função principal, poker.
[Norvig]现在我们来解决主程序,poker。
它的输入是一个手牌的列表,
返回最好的手牌。
输入列表,返回最好的手牌。
我还没想好怎么写这个函数,
但至少我有原型了。
现在,我们要从一个列表里找出排位最高的手牌。
我们手头有什么提示吗?想想看。
Python里有没有内建函数能从列表里选出排位最高的元素?
如果你知道,给出它的名字。