@@ -917,7 +917,7 @@ msgid ""
917917">>> fib(2000)\n"
918918"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597"
919919msgstr ""
920- ">>> def fib(n): #wypisz ciąg Fibonacciego do n\n"
920+ ">>> def fib(n): # wypisz ciąg Fibonacciego do n\n"
921921"... \"\"\" Wypisz ciąg Fibonacciego do n.\"\"\" \n"
922922"... a, b = 0, 1\n"
923923"... while a < n:\n"
@@ -1921,6 +1921,17 @@ msgid ""
19211921"-- This parrot wouldn't VOOM if you put four million volts through it. E's "
19221922"bleedin' demised !"
19231923msgstr ""
1924+ ">>> def parrot(voltage, state='sztywna', action='fru'):\n"
1925+ "... print(\" -- Ta papuga nie zrobi\" , action, end=' ')\n"
1926+ "... print(\" nawet jeśli podłączę ją do\" , voltage, \" woltów.\" , end=' "
1927+ "')\n"
1928+ "... print(\" Jest\" , state, \" !\" )\n"
1929+ "...\n"
1930+ ">>> d = {\" voltage\" : \" czterech milionów\" , \" state\" : \" sztywna jak "
1931+ "kłoda\" , \" action\" : \" FRUU\" }\n"
1932+ ">>> parrot(**d)\n"
1933+ "-- Ta papuga nie zrobi FRUU nawet jeśli podłączę ją do czterech milionów "
1934+ "woltów. Jest sztywna jak kłoda !"
19241935
19251936msgid "Lambda Expressions"
19261937msgstr "Wyrażenia Lambda"
@@ -1953,6 +1964,14 @@ msgid ""
19531964">>> f(1)\n"
19541965"43"
19551966msgstr ""
1967+ ">>> def make_incrementor(n):\n"
1968+ "... return lambda x: x + n\n"
1969+ "...\n"
1970+ ">>> f = make_incrementor(42)\n"
1971+ ">>> f(0)\n"
1972+ "42\n"
1973+ ">>> f(1)\n"
1974+ "43"
19561975
19571976msgid ""
19581977"The above example uses a lambda expression to return a function. Another "
@@ -1967,6 +1986,10 @@ msgid ""
19671986">>> pairs\n"
19681987"[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]"
19691988msgstr ""
1989+ ">>> pairs = [(1, 'jeden'), (2, 'dwa'), (3, 'trzy'), (4, 'cztery')]\n"
1990+ ">>> pairs.sort(key=lambda pair: pair[1])\n"
1991+ ">>> pairs\n"
1992+ "[(4, 'cztery'), (2, 'dwa'), (1, 'jeden'), (3, 'trzy')]"
19701993
19711994msgid "Documentation Strings"
19721995msgstr "Napisy dokumentujące (docstringi)"
@@ -2039,6 +2062,17 @@ msgid ""
20392062"\n"
20402063" No, really, it doesn't do anything."
20412064msgstr ""
2065+ ">>> def my_function():\n"
2066+ "... \"\"\" Nie robi nic, ale dokumentuje to.\n"
2067+ "...\n"
2068+ "... Nie, naprawdę, ona nic nie robi.\n"
2069+ "... \"\"\" \n"
2070+ "... pass\n"
2071+ "...\n"
2072+ ">>> print(my_function.__doc__)\n"
2073+ "Nie robi nic, ale dokumentuje to.\n"
2074+ "\n"
2075+ " Nie, naprawdę, ona nic nie robi."
20422076
20432077msgid "Function Annotations"
20442078msgstr "Adnotacje funkcji"
@@ -2084,6 +2118,16 @@ msgid ""
20842118"Arguments: spam eggs\n"
20852119"'spam and eggs'"
20862120msgstr ""
2121+ ">>> def f(ham: str, eggs: str = 'jajka') -> str:\n"
2122+ "... print(\" adnotacje:\" , f.__annotations__)\n"
2123+ "... print(\" argumenty:\" , ham, eggs)\n"
2124+ "... return ham + ' i ' + eggs\n"
2125+ "...\n"
2126+ ">>> f('szynka')\n"
2127+ "adnotacje: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class "
2128+ "'str'>}\n"
2129+ "argumenty: szynka jajka\n"
2130+ "'szynka i jajka'"
20872131
20882132msgid "Intermezzo: Coding Style"
20892133msgstr "Intermezzo: Styl kodowania"
0 commit comments