From cb4892943214d47f60622b2c309ed4555b93f327 Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Sun, 20 Oct 2019 00:31:41 +0200 Subject: [PATCH] =?UTF-8?q?Seznamy:=20N=C4=9Bco=20nav=C3=ADc=20o=20gener?= =?UTF-8?q?=C3=A1torech?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 03-seznamy/03-seznamy.tex | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/03-seznamy/03-seznamy.tex b/03-seznamy/03-seznamy.tex index b7cae73..403122b 100644 --- a/03-seznamy/03-seznamy.tex +++ b/03-seznamy/03-seznamy.tex @@ -200,4 +200,40 @@ m % ---------------------------------------------------------------------- +\begin{frame}{Něco navíc o generátorech} + +\py{% +range(5) +}{% +range(0, 5) +} + +\py{% +list(range(5)) +}{% +[0, 1, 2, 3, 4] +} + +\py{% +list(range(0, 20, 3)) +}{% +[0, 3, 6, 9, 12, 15, 18] +} + +\py{% +list(range(10, 0)) +}{% +[] +} + +\py{% +list(range(10, 0, -1)) +}{% +[10, 9, 8, 7, 6, 5, 4, 3, 2, 1] +} + +\end{frame} + +% ---------------------------------------------------------------------- + \end{document} -- GitLab