Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Čermák Petr
Prm1
Commits
f21d38e6
Commit
f21d38e6
authored
Nov 15, 2019
by
Mareš Martin
Browse files
07: Příklad na zip
parent
03199434
Changes
1
Hide whitespace changes
Inline
Side-by-side
07-compr/07-compr.tex
View file @
f21d38e6
...
...
@@ -75,6 +75,29 @@ b \cmt{(přiřazení každého prvku n-tice/seznamu zvlášť)}
% ----------------------------------------------------------------------
\begin{frame}
{
Příklad: Zipování seznamů
}
\py
{
%
x = [1, 2, 3]
\\
y = ["a", "b", "c"]
\\
list(zip(x, y))
}{
%
[(1, 'a'), (2, 'b'), (3, 'c')]
}
\py
{
%
for i, j in zip(x, y):
\\
\>
print(i, j)
}{
%
1 a
\\
2 b
\\
3 c
}
\end{frame}
% ----------------------------------------------------------------------
\begin{frame}
{
List comprehension
}
\py
{
%
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment