Skip to content
Snippets Groups Projects
Commit cb489294 authored by Martin Mareš's avatar Martin Mareš
Browse files

Seznamy: Něco navíc o generátorech

parent e12423fc
Branches
No related tags found
No related merge requests found
...@@ -200,4 +200,40 @@ m ...@@ -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} \end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment