Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Programování 1 pro matematiky
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Programování 1 pro matematiky
Commits
a71d9073
Commit
a71d9073
authored
5 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Slovníky: Příklady
parent
68ad052a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
08-slovniky/kontakty.py
+26
-0
26 additions, 0 deletions
08-slovniky/kontakty.py
08-slovniky/robutek.py
+34
-0
34 additions, 0 deletions
08-slovniky/robutek.py
with
60 additions
and
0 deletions
08-slovniky/kontakty.py
0 → 100644
+
26
−
0
View file @
a71d9073
# Seznam kontaktů
kontakty
=
[
{
"
jmeno
"
:
"
Pokusný
"
,
"
prijmeni
"
:
"
Králík
"
,
"
telefony
"
:
[
"
123456789
"
,
"
+420999888777
"
],
"
adresa
"
:
{
"
ulice
"
:
"
Norní
"
,
"
dum
"
:
"
42/1b
"
,
"
mesto
"
:
"
Králíky
"
,
"
psc
"
:
"
987 65
"
,
},
},
{
"
jmeno
"
:
"
Kocour
"
,
"
prijmeni
"
:
"
Mikeš
"
,
"
telefony
"
:
[],
"
adresa
"
:
{
"
ulice
"
:
"
Josefa Lady
"
,
"
dum
"
:
"
1
"
,
"
mesto
"
:
"
Hrusice
"
,
"
psc
"
:
"
251 66
"
,
}
},
]
This diff is collapsed.
Click to expand it.
08-slovniky/robutek.py
0 → 100755
+
34
−
0
View file @
a71d9073
#!/usr/bin/env python3
x
,
y
=
0
,
0
dx
,
dy
=
1
,
0
def
prikaz_krok
():
global
x
,
y
,
dx
,
dy
x
+=
dx
y
+=
dy
def
prikaz_vlevo
():
global
dx
,
dy
dx
,
dy
=
-
dy
,
dx
def
prikaz_vpravo
():
global
dx
,
dy
dx
,
dy
=
dy
,
-
dx
prikazy
=
{
"
krok
"
:
prikaz_krok
,
"
vlevo
"
:
prikaz_vlevo
,
"
vpravo
"
:
prikaz_vpravo
,
}
def
proved
(
prikaz
):
if
prikaz
in
prikazy
:
prikazy
[
prikaz
]()
else
:
print
(
"
Neznámý příkaz!
"
)
while
True
:
print
(
f
"
Pozice: (
{
x
}
,
{
y
}
), směr: (
{
dx
}
,
{
dy
}
)
"
)
prikaz
=
input
(
"
Příkaz:
"
)
proved
(
prikaz
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment